#include<bits/stdc++.h>
using namespace std;
#define int long long
struct reader{
	#define gc ch=getchar()
	template<typename T>
	reader&operator>>(T&x){
		char gc;x=0;int f=1;
		for(;!isdigit(ch);gc)ch=='-'&&(f=-f);
		for(;isdigit(ch);gc)x=x*10+ch-'0';
		x*=f;return*this;
	}
}fin;
const int N=500005,M=2000006,mod=1e9+7;
int n,m;
int h[N],nxt[M],to[M],t=1,c,fr[M];
void add(int u,int v){
	nxt[++t]=h[u],h[u]=t,to[t]=v,fr[t]=u;
	nxt[++t]=h[v],h[v]=t,to[t]=u,fr[t]=v;
}
int dfn[N],low[N],cut[M];
void tar(int u,int p=0){
	dfn[u]=low[u]=++c;int v;
	for(int e=h[u];e;e=nxt[e])if((v=to[e])!=p){
		if(!dfn[v]){
			tar(v,u),low[u]=min(low[u],low[v]);
			if(low[v]==dfn[v])cut[e]=cut[e^1]=1;
		}
		else low[u]=min(low[u],dfn[v]);
	}
}
int id,bel[N],cn[N],vis[N];
void dfs(int u,int p=0){
	bel[u]=id;cn[id]++;vis[u]=1;
	for(int e=h[u],v;e;e=nxt[e])if((v=to[e])!=p&&!cut[e]&&!vis[v])dfs(v,u);
}
int fpw(int x,int a){int ret=1;for(;a;x=x*x%mod,a>>=1)a&1&&(ret=ret*x%mod);return ret;}
vector<int>g[N];
#define pb push_back
int ans,f[N],ff[N],sz[N];
void gsz(int u,int p=0){sz[u]=1;for(auto v:g[u])if(v!=p)gsz(v,u),sz[u]+=sz[v];}
void Dfs(int u,int p=0){
	ff[u]=1;
	f[u]=(fpw(2,cn[u])-1+mod)%mod;
	for(auto v:g[u])if(v!=p){
		Dfs(v,u);
		ff[u]=(f[v]+ff[v]+fpw(2,sz[v]))%mod*ff[u]%mod;
		f[u]=(f[v]+ff[v]+fpw(2,sz[v]))%mod*f[u]%mod;
	}
	ff[u]=(ff[u]-fpw(2,sz[u]-1)+mod)%mod;
//	printf("%lld\n",f[u]*fpw(2,id-sz[u]));
	(ans+=f[u]*fpw(2,id-sz[u])%mod)%=mod;
}
int mul;
signed main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
//	freopen("barrack.in","r",stdin);
//	freopen("1.in","r",stdin);
	fin>>n>>m;
	for(int i=1,a,b;i<=m;i++)fin>>a>>b,add(a,b);
	tar(1);
	for(int i=1;i<=n;i++)if(!vis[i])id++,dfs(i);
	mul=fpw(2,m-(id-1));
	for(int i=2;i<=t;i++)if(cut[i])g[bel[fr[i]]].pb(bel[to[i]]);
	gsz(1);Dfs(1);
	printf("%lld",ans*mul%mod);
}