#include<bits/stdc++.h>
using namespace std;
#define N 1000005
int read(){
	int w=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9')f=(c=='-'?-f:f),c=getchar();
	while(c>='0'&&c<='9')w=w*10+c-'0',c=getchar();
	return w*f;
}
const int mod=1e9+7;
int reduce(int x){
	return x>=mod?x-mod:x;
}
void inc(int&x,int y){
	x+=y,x=x>=mod?x-mod:x;
}
void dec(int&x,int y){
	x-=y,x=x>=0?x:x+mod;
}
int n,m,p[N],dfn[N],low[N],dfx,st[N],top,bel[N],siz[N],nt[N],cnt,f[N],ans;
vector<int>g[N],e[N];
void tarjan(int u,int ft){
	dfn[u]=++dfx,low[u]=dfn[u],st[++top]=u;
	for(auto v:g[u])
		if(!dfn[v])tarjan(v,u),low[u]=min(low[u],low[v]);
		else if(v!=ft)low[u]=min(low[u],dfn[v]);
	if(low[u]==dfn[u]){
		cnt++;
		while(st[top]!=u)bel[st[top]]=cnt,nt[cnt]++,top--;
		bel[st[top]]=cnt,nt[cnt]++,top--;
	}
}
void init(){
	p[0]=1;
	for(int i=1;i<N;i++)
		p[i]=reduce(p[i-1]<<1);
}
void dfs(int u,int ft){
	f[u]=1,siz[u]=1;
	for(auto v:e[u]){
		if(v==ft)continue;
		dfs(v,u),siz[u]+=siz[v];
		f[u]=1ll*f[u]*(p[siz[v]]+f[v])%mod;
	}
	f[u]=1ll*f[u]*p[nt[u]]%mod;
	dec(f[u],p[siz[u]-1]);
}
signed main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	init();
	n=read(),m=read();
	for(int i=1;i<=m;i++){
		int x=read(),y=read();
		g[x].push_back(y);
		g[y].push_back(x);
	}
	tarjan(1,0);
	for(int u=1;u<=n;u++)
		for(auto v:g[u])
			if(bel[u]!=bel[v])e[bel[u]].push_back(bel[v]);
	dfs(1,0),ans=1ll*f[1]*p[m-siz[1]+1]%mod;
	for(int i=2;i<=cnt;i++)
		inc(ans,1ll*f[i]*p[m-siz[i]]%mod);
	printf("%d\n",ans);
	return 0;
}