#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
#define MADE_IN_HEAVEN ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
const int N=5e5+10;
const ll M=1e9+7;
int n,m;
int h[N],nx[N],type[N],v[N],cnt=0;
int a[N];
void add(int uu,int vv){
	v[++cnt]=vv;
	nx[cnt]=h[uu];
	h[uu]=cnt;
}
int dp[N][5];
void dfs(int p,int fa){
	int f=0;
	if(p==1){
		for(int i=h[p];~i;i=nx[i]){
			f=1;
			dfs(v[i],p);
			dp[p][1]+=dp[v[i]][0]*2%M+dp[v[i]][1]%M;
			dp[p][1]%=M;
			dp[p][0]+=dp[v[i]][0]*2%M;
			dp[p][0]%=M;
		}
	}
	else{
		for(int i=h[p];~i;i=nx[i]){
			if(v[i]==fa) continue;
			f=1;
			dfs(v[i],p);
			dp[p][1]+=dp[v[i]][0]*2%M+dp[v[i]][1]%M;
			dp[p][1]%=M;
			dp[p][0]+=dp[v[i]][0]*2%M;
			dp[p][0]%=M;
		}
	}
	if(!f){
		dp[p][1]=1;
		dp[p][0]=1;
	}
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	memset(h,-1,sizeof h);
	MADE_IN_HEAVEN
	cin>>n>>m;
	for(int i=1,uu,vv;i<=m;i++){
		cin>>uu>>vv;
		add(uu,vv);
		add(vv,uu);
	}
	if(m==n-1){
		dfs(1,1);
//		for(int i=1;i<=n;i++) cout<<i<<" "<<dp[i][1]<<" "<<dp[i][0]<<"\n";
		cout<<(dp[1][1]+dp[1][0])%M<<"\n";
	}
	else{
		ll ans=(1ll<<(ll)m)%M;
		ans=(ans*((1ll<<(ll)n)%M-1))%M;
		cout<<ans<<"\n";
	}
	return 0;
}