#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int mod=1000000007;
int half(const int&x){
	return ll(x)*((mod+1)/2)%mod;
	// return ((x&1)?(x+mod):x)>>1;
}
ll quickpow(ll x,int k,ll ret=1){
	for(; k; k>>=1,x=x*x%mod)
		(k&1)&&(ret=ret*x%mod);
	return ret;
}
constexpr int max_n=500000;
vector<int>g[max_n+1];
int a[max_n+1];
int ans;
int dp[max_n+1];
void dfs(const int u,const int p=0){
	// fprintf(stderr,"dfs %d(%d) %d\n",u,a[u],p);
	for(const int&v:g[u])
		if(v!=p)
			dfs(v,u);
	ll prd=1,sum=0;
	for(const int&v:g[u])
		if(v!=p){
			const int val=half(dp[v]);
			prd=prd*(val+1)%mod,sum+=val;
		}
	sum%=mod;
	prd?--prd:(prd=mod-1);
	// fprintf(stderr,"%d: %lld %lld %d (orig %d)\n",u,sum,prd,a[u],ans);
	ll vu=quickpow(2,a[u]);
	dp[u]=(prd*vu+vu-1)%mod;
	ans=(ans+(prd-sum+mod)%mod*vu+(sum+1)*(vu-1))%mod;
	// fprintf(stderr,"%d: %d %d\n",u,ans,dp[u]);
}
void solve(const int n,const int vm){
	ans=0;
	dfs(1);
	printf("%lld\n",quickpow(2,vm,ans));
}
vector<int>g1[max_n+1];
int low[max_n+1],dfncnt,num[max_n+1],ncomp,stk[max_n+1],top;
void tarjan(const int u,int p=0){
	const int dfu=low[u]=++dfncnt;
	stk[++top]=u;
	for(const int&v:g1[u])
		if(v==p)
			p=0;
		else{
			if(low[v]){
				if(low[v]<low[u])
					low[u]=low[v];
				continue;
			}
			tarjan(v,u);
			if(low[v]<low[u])
				low[u]=low[v];
		}
	if(low[u]==dfu){
		++ncomp;
		for(; stk[top]!=u; --top)
			num[stk[top]]=ncomp;
		num[u]=ncomp;
		--top;
	}
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=1,u,v; i<=m; ++i,g1[u].emplace_back(v),g1[v].emplace_back(u))
		scanf("%d%d",&u,&v);
	tarjan(1);
	for(int i=1; i<=n; ++i){
		++a[num[i]];
		for(const int&v:g1[i])
			if(num[i]!=num[v])
				g[num[i]].emplace_back(num[v]);
	}
	solve(ncomp,m);
	return 0;
}