#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=5e5+5;
const ll mod=1e9+7;
int n,m,vet[N<<2],nxt[N<<2],head[N],sz[N],edge,scc_point[N],scc_edge[N];
ll dp[N][2][2],cnt[N];
int dfn[N],low[N],dfs_clock,sta[N],top,tag[N],u[N],v[N],scc_num;
int fa[N],f[N][2];
bool mat[3005][3005];
ll qpow(ll a, int b){
	ll ret=1;
	for(; b; b>>=1, a=a*a%mod)
		if(b&1) ret=ret*a%mod;
	return ret;
}
void add(int u, int v){
	vet[++edge]=v;
	nxt[edge]=head[u];
	head[u]=edge;
}
void Tarjan(int u, int fa){
	dfn[u]=low[u]=++dfs_clock;sta[++top]=u;
	for(int e = head[u]; e; e = nxt[e]){
		int v=vet[e];
		if(!dfn[v]){
			Tarjan(v,u);
			low[u]=min(low[u],low[v]);
		}else if(v!=fa && !tag[v]) low[u]=min(low[u],dfn[v]);
	}
	if(dfn[u]==low[u]){
		scc_num++;
		while(sta[top]!=u){
			tag[sta[top]]=scc_num;
			scc_point[scc_num]++;
			top--;
		}
		tag[sta[top]]=scc_num;
		scc_point[scc_num]++;
		top--;
	}
}
void dfs1(int u, int father){
	sz[u]=1;
	for(int e = head[u]; e; e = nxt[e]){
		int v=vet[e];
		if(v!=father){
			dfs1(v,u);
			sz[u]+=sz[v];
		}
	}
}
void dfs2(int u, int father){
	if(sz[u]==1){
		dp[u][0][0]=qpow(2ll,scc_edge[u]);dp[u][1][0]=cnt[u];
		return;
	}
	for(int e = head[u]; e; e = nxt[e]){
		int v=vet[e];
		if(v!=fa[u]){
			dfs2(v,u);
			dp[u][0][0]=(dp[u][0][0]+dp[v][0][0]*2%mod*qpow(2ll,scc_edge[u])%mod)%mod;
			dp[u][1][0]=(dp[u][1][0]+(cnt[u])*dp[v][0][0]%mod*2%mod)%mod;
			dp[u][0][1]=(dp[u][0][1]+dp[v][1][0]%mod*2%mod*qpow(2ll,scc_edge[u])%mod)%mod;
			dp[u][1][1]=(dp[u][1][1]+dp[v][1][0]%mod*(cnt[u])%mod)%mod;
			if(sz[v]>1){
				dp[u][0][1]=(dp[u][0][1]+(dp[v][0][1]+dp[v][1][1])%mod*2%mod*qpow(2ll,scc_edge[u])%mod)%mod;
				dp[u][1][1]=(dp[u][1][1]+(dp[v][0][1]+dp[v][1][1])%mod*(cnt[u])%mod)%mod;
			}
		}
	}
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= m; i++){
		scanf("%d%d", &u[i], &v[i]);
		add(u[i],v[i]);add(v[i], u[i]);
	}
	for(int i = 1; i <= n; i++)
		if(!dfn[i]) Tarjan(i,i);
	memset(head,0,sizeof(head));
	edge=0;
	for(int i = 1; i <= m; i++)
		if(tag[u[i]]==tag[v[i]]) scc_edge[tag[u[i]]]++;
		else{
			add(tag[u[i]],tag[v[i]]);
			add(tag[v[i]],tag[u[i]]);
		}
	int rt=tag[1];
	for(int i = 1; i <= scc_num; i++) cnt[i]=qpow(2ll,scc_edge[i])*(qpow(2ll,scc_point[i])-1+mod)%mod;
	dfs1(rt,0);
	dfs2(rt,0);
	printf("%lld\n", (dp[rt][1][0]+dp[rt][0][1]+dp[rt][1][1])%mod);
	return 0;
}