#include<bits/stdc++.h>
#define For(i,x,y) for (int i=(x);i<=(y);i++)
#define FOR(i,x,y) for (int i=(x);i<(y);i++)
#define Dow(i,x,y) for (int i=(x);i>=(y);i--)
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define fil(a,b) memset(a,b,sizeof a)
#define all(x) x.begin(),x.end()
#define siz(x) ((int)x.size())
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pa;
typedef pair<ll,ll> PA;
typedef vector<int> poly;
inline ll read(){
	ll x=0,f=1;char c=getchar();
	while ((c<'0'||c>'9')&&(c!='-')) c=getchar();
	if (c=='-') f=-1,c=getchar();
	while (c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
	return x*f;
}

const int N = 5e5+10, M = 1e6+10;
int n,m;
pa ed[M];
poly e[N];

int low[N],dfn[N],Tim,top,stk[N],cnt,bel[N],siz[N],siz2[N];
bool flag[N];
inline void dfs(int u,int fa){
	dfn[u]=low[u]=++Tim,stk[++top]=u,flag[u]=1;
	for (auto v:e[u]) if (v!=fa){
		if (!dfn[v]) dfs(v,u),low[u]=min(low[u],low[v]);
		else if (flag[v]) low[u]=min(low[u],dfn[v]);
	}
	if (low[u]==dfn[u]){
		++cnt;
		for (;stk[top+1]!=u;--top){
			flag[stk[top]]=0;
			bel[stk[top]]=cnt;
			siz[cnt]++;
		}
	}
}

const int mod = 1e9+7;
int pw[M*2],f[N][2],sized[N],ans;
inline void Dfs(int u,int fa){
	f[u][0]=1;
	f[u][1]=0;
	sized[u]=siz2[u];
	for (auto v:e[u]) if (v!=fa){
		Dfs(v,u);
		f[u][1]=(1ll*f[u][1]*(f[v][1]+2ll*f[v][0])+1ll*f[v][1]*f[u][0])%mod;
		f[u][0]=1ll*f[u][0]*f[v][0]*2%mod;
		sized[u]+=sized[v]+1;
	}
	int t=1ll*pw[siz2[u]]*(pw[siz[u]]+mod-1)%mod;
	ans=(ans+1ll*(f[u][0]+f[u][1])*t%mod*pw[m-sized[u]])%mod;
//	printf("%d %d %d %d\n",u,ans,f[u][0],f[u][1]);
	poly g(3,0);
	g[0]=1;
	for (auto v:e[u]) if (v!=fa){
		poly G(3,0);
		For(i,0,2){
			G[i]=(G[i]+1ll*g[i]*f[v][0]*2)%mod;
			G[min(2,i+1)]=(G[min(2,i+1)]+1ll*g[i]*f[v][1])%mod;
		}
		g=G;
	}
	ans=(ans+1ll*pw[siz2[u]]*pw[m-sized[u]]%mod*g[2])%mod;
//	printf("%d\n",ans);
	f[u][1]=(1ll*f[u][1]*pw[siz2[u]]%mod*pw[siz[u]]+1ll*f[u][0]*t)%mod;
	f[u][0]=1ll*f[u][0]*pw[siz2[u]]%mod;
}

int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	n=read(),m=read();
	For(i,1,m){
		int x=read(),y=read();
		ed[i]=mp(x,y);
		e[x].pb(y);
		e[y].pb(x);
	}
	dfs(1,0);
	For(i,1,cnt) e[i].clear();
	For(i,1,m){
		int x=ed[i].fi,y=ed[i].se;
		if (bel[x]==bel[y]) siz2[bel[x]]++;
		else {
			e[bel[x]].pb(bel[y]);
			e[bel[y]].pb(bel[x]);
		}
	}
	//For(i,1,n) printf("%d %d\n",i,bel[i]);
	pw[0]=1;
	For(i,1,2e6) pw[i]=1ll*pw[i-1]*2%mod;
	Dfs(1,0);
	printf("%d\n",ans);
}
