#include<bits/stdc++.h>
#define gc getchar
#define pc putchar
#define F(i,x,y) for(int i=x;i<=y;++i)
#define R(i,x,y) for(int i=x;i>=y;--i)
#define min std::min
#define max std::max
typedef long long LL;
inline int read(){
	int x=0;char ch=gc();bool p=1;
	while (!isdigit(ch)) ch=='-'?p=0:0,ch=gc();
	while ( isdigit(ch)) x=(x<<1)+(x<<3)+(ch^'0'),ch=gc();
	return p?x:-x;
}
const int N=1e6+5,M=1e6+5,MOD=1e9+7;
int n,m,f[N],g[N],ans=0;
std::vector<int> G[N],P[N];
int low[N],dfn[N],tot,st[N],top,c[N],cnt,E[N],nd[N],sum;
bool vis[N];
std::vector<int> C[N];
inline int fpow(int a,int b){
	int s=1;
	while (b){
		if (b&1) s=(LL)s*a%MOD;
		a=(LL)a*a%MOD,b>>=1;
	}
	return s;
}
void Tarjan(int cur,int fa){
	dfn[cur]=low[cur]=++tot;
	st[++top]=cur;
	vis[cur]=1;
	F(i,0,(int)G[cur].size()-1){
		int to=G[cur][i];
		if (to==fa) continue;
		if (vis[to]&&dfn[to]) low[cur]=min(low[cur],dfn[to]);
		else if (!dfn[to]) Tarjan(to,cur),low[cur]=min(low[cur],low[to]);
	}
	if (low[cur]==dfn[cur]){
		++cnt;
		while (st[top+1]!=cur){
			C[cnt].push_back(st[top]);
			c[st[top]]=cnt;
			vis[st[top]]=0;
			--top;
		}
	}
}
void Dfs(int cur,int fa){
	f[cur]=(LL)(fpow(2,nd[cur])-1)*fpow(2,E[cur])%MOD;
	f[cur]=(f[cur]+MOD)%MOD;
	g[cur]=fpow(2,E[cur]);
	F(i,0,(int)P[cur].size()-1){
		int to=P[cur][i];
		if (to==fa) continue;
		Dfs(to,cur);
		f[cur]=(((LL)f[cur]*g[to]%MOD*2ll%MOD+(LL)g[cur]*f[to]%MOD)%MOD
		+(LL)f[cur]*f[to]%MOD)%MOD;
		g[cur]=(LL)g[cur]*g[to]%MOD*2ll%MOD;
		//printf("renew cur = %d, to = %d, f[cur] = %d, g[cur] = %d\n",cur,to,f[cur],g[cur]);
	}
	if (cur!=1) ans=(ans+(LL)f[cur]*sum%MOD*fpow(g[cur],MOD-2)%MOD*fpow(2,MOD-2)%MOD)%MOD;
	else ans=(ans+(LL)f[cur]*sum%MOD*fpow(g[cur],MOD-2)%MOD)%MOD;
	//printf("cur = %d, f = %d, g = %d\n",cur,f[cur],g[cur]);
}
int Dfs0(int cur,int fa){
	int res=fpow(2,E[cur]);
	F(i,0,(int)P[cur].size()-1){
		int to=P[cur][i];
		if (to==fa) continue;
		res=(LL)res*Dfs0(to,cur)%MOD*2ll%MOD;
	}
	return res;
}
signed main(){
	//return system("fc barrack.out barrack4.ans"),0;
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	n=read(),m=read();
	F(i,1,m){
		int x=read(),y=read();
		G[x].push_back(y),G[y].push_back(x);
	}
	Tarjan(1,0);
	//int EEE=0;
	F(i,1,cnt){
		F(j,0,(int)C[i].size()-1){
			int cur=C[i][j];
			//printf("i = %d, cur = %d\n",i,cur);
			F(k,0,(int)G[cur].size()-1){
				int to=G[cur][k];
				if (c[to]==c[cur]){
					++E[c[cur]];
				}else{
					P[c[cur]].push_back(c[to]);
				}
			}
		}
		nd[i]=C[i].size();
		E[i]/=2;
		//EEE+=E[i];
		//printf("E[%d] = %d\n",i,E[i]);
	}
	//printf("::%d, cnt = %d\n",m-EEE,cnt);
	//printf("cnt = %d\n",cnt);
	sum=Dfs0(1,0);
	Dfs(1,0);
	printf("%d\n",ans);
	return 0;
}/*
5 4
1 2
1 3
2 4
2 5
*/
