#include<bits/stdc++.h>
using namespace std;
#define pb push_back
inline int read(){
	char ch=getchar();int x=0;bool f=0;
	for(;!isdigit(ch);ch=getchar())if(ch=='-')f=1;
	for(;isdigit(ch);ch=getchar())x=(x<<1)+(x<<3)+(ch^48);
	if(f){x=-x;}return x;
}
#define int long long
const int mod=1e9+7;
const int maxn=1e6+5;
int n,m,vis[maxn],st[maxn],x,y,ans,sum;
int dfn[maxn],low[maxn],cnt,top,s[maxn],u[maxn],v[maxn];
int id[maxn],f[maxn],sz[maxn],pw[maxn],tot;
vector<int>g[maxn],e[maxn];
void tarjan(int x,int fa){
	dfn[x]=low[x]=++cnt;
	st[++top]=x;vis[x]=1;
	for(auto i:g[x])if(i^fa){
		if(!dfn[i]){
			tarjan(i,x);
			low[x]=min(low[x],low[i]);
		}else if(vis[i]){
			low[x]=min(low[x],dfn[i]);
		}
	}
	if(low[x]==dfn[x]){
		tot++;id[x]=tot;
		while(st[top]!=x){
			id[st[top]]=tot;s[tot]++;vis[st[top]]=0;
			top--;
		}top--;s[tot]++;vis[x]=0;
	}
}
void dfs(int x,int fa){
	sz[x]=1;
	for(auto i:e[x])if(i^fa){
		dfs(i,x);sz[x]+=sz[i];
	}f[x]=pw[s[x]];
	for(auto i:e[x])if(i^fa){
		f[x]=f[x]*(1+f[i])%mod;
	}
	//for(auto i:e[x])if(i^fa)f[x]=(f[x]-f[i])%mod;
	int u=f[x];//cout<<f[x]<<endl;
	for(auto i:e[x])if(i^fa){u=(u-f[i]*(pw[sz[x]-sz[i]-1]-1)%mod+mod)%mod;}
	u=u-1;//cout<<u<<endl;
	ans=ans+u*pw[tot-sz[x]]%mod;
}
namespace solve1{
	int b[maxn],s1,a[maxn];
	void dfs2(int x,int fa){
		for(auto i:e[x])if(i^fa){
			dfs2(i,x);
			b[x]=b[x]|b[i];
		}
		if(b[x])s1++;
	}
	void dfs(int x){
		if(x==tot+1){
			int id=0;
			s1=0;int u=1;
			for(int i=1;i<=tot;i++){
				if(a[i]){
					id=i;u=u*(pw[s[i]]-1)%mod;
				}
				b[i]=a[i];
			}//cout<<id<<endl;
			
			if(!id)return;
			dfs2(id,0);
			
			ans=ans+u*pw[tot-s1];return;
		}a[x]=1;
		dfs(x+1);
		a[x]=0;
		dfs(x+1);
	}
	void work(){
		dfs(1);
		ans=ans*sum%mod;
		cout<<ans<<endl;
	}
}
signed main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	n=read(),m=read();
	for(int i=1;i<=m;i++){
		x=read(),y=read(),g[x].pb(y),g[y].pb(x);
		u[i]=x,v[i]=y;
	}pw[0]=1;
	for(int i=1;i<=max(n,m);i++)pw[i]=pw[i-1]*2%mod;
	tarjan(1,0);sum=1;
	for(int i=1;i<=m;i++){
		if(id[u[i]]!=id[v[i]]){
			e[id[u[i]]].pb(id[v[i]]);
			e[id[v[i]]].pb(id[u[i]]);
		}
		else{
			sum=sum*2%mod;
		}
	}
	if(tot<=16)solve1::work();
	else{
		dfs(1,0);
		ans=ans*sum%mod;
		cout<<ans<<endl;
	}
	return 0;
}
