#include<bits/stdc++.h>
#define int long long
using namespace std;
const int MOD=1e9+7;
int n,m,INF,ans;
int nxt[2000005],head[1000005],v[1000005],cnt,dfncnt;
int dfn[1005],low[1005],tw[1000005];
int nxtt[2000005],headd[1000005],vv[2000005],cntt,pt;
int w[1000005],sumw[1000005];
bool vis[1000005];
int had[1000005];
void add2(int x,int y){
	nxtt[++cntt]=headd[x],headd[x]=cntt,vv[cntt]=y;
}
void add(int x,int y){
	nxt[++cnt]=head[x],head[x]=cnt,v[cnt]=y;
}
int qpow(int y){
	return tw[y];
}
void dfs(int x){
	dfn[x]=low[x]=++dfncnt;
	for(int i=head[x];i;i=nxt[i]){
		int y=v[i];
		if(!dfn[y])
			dfs(y); 
	}
}
void dfs2(int x,int fa){
	vis[x]=1;
	for(int i=head[x];i;i=nxt[i]){
		int y=v[i];
		if(y==fa)continue;
		if(!vis[y])dfs2(y,x);
		else if (dfn[x]<=low[y])low[y]=min(low[y],dfn[x]);
		low[x]=min(low[x],low[y]);
	}
}
void dfs3(int x,int fa){
	sumw[x]=w[x];
	for(int i=headd[x];i;i=nxtt[i]){
		int y=vv[i];
		if(y==fa)continue;
		dfs3(y,x);
		int sz1=sumw[y],sz2=n-sz1;
		int tmp=qpow(m-1)*(qpow(sz1)-1+MOD)%MOD*(qpow(sz2)-1+MOD)%MOD;
		ans=(ans-tmp+MOD)%MOD;
		sumw[x]+=sumw[y];
	}
}
bool book[100005];
int sz[100005];
signed main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	memset(low,0x3f,sizeof(low));
	INF=low[0];
	tw[0]=1;
	for(int i=1;i<=1000000;i++)
		tw[i]=tw[i-1]*2%MOD;
	scanf("%lld%lld",&n,&m);
	for(int i=1;i<=m;i++){
		int x,y;
		scanf("%lld%lld",&x,&y);
		add(x,y);add(y,x);
	}
	dfs(1);
	if(m!=n-1)
		dfs2(1,0);
	ans=qpow(n+m);
	ans=(ans-qpow(m)+MOD)%MOD;
	for(int i=1;i<=n;i++){
		sz[low[i]]++;
	}
	for(int i=1;i<=n;i++){
		if(!had[low[i]]){
			w[++pt]=sz[low[i]];
			had[low[i]]=pt;
		}
	}
	for(int x=1;x<=n;x++){
		for(int i=head[x];i;i=nxt[i]){
			if(book[(i+1)/2])continue;
			book[(i+1)/2]=1;
			int y=v[i];
			if(low[x]!=low[y]){
				add2(had[low[x]],had[low[y]]);
				add2(had[low[y]],had[low[x]]);
//				int sz1=sz[low[x]],sz2=n-sz1;
//				int tmp=qpow(m-1)*(qpow(sz1)-1+MOD)%MOD*(qpow(sz2)-1+MOD)%MOD;
//				ans=(ans-tmp+MOD)%MOD;
			}
		}
	}
	dfs3(1,0);
	printf("%lld\n",ans);
}