#include<bits/stdc++.h>
using namespace std;
inline int read()
{
	char c=getchar();
	int x=0;
	while(!isdigit(c)) c=getchar();
	while(isdigit(c)) x=x*10+(c&15),c=getchar();
	return x;
}
vector<pair<int,int>> e[500003];
vector<int> ee[500003];
struct edge{int u,v;}a[1000003];
int fa[500003][19],dep[500003],f[500003];
int eid[500003],rt[500003],sz[500003];
bool vis[500003],flg[1000003];
const int p=1e9+7,N=1500000;
int pw[1500003];
void dfs(int x)
{
	for(int i=1; i<19; ++i)
		fa[x][i]=fa[fa[x][i-1]][i-1];
	vis[x]=1;
	for(auto cur:e[x])
	{
		int y=cur.first,z=cur.second;
		if(!vis[y])
			eid[y]=z,dep[y]=dep[x]+1,fa[y][0]=x,dfs(y),flg[z]=1;
	}
	return ;
}
void dfs2(int x)
{
	for(auto cur:e[x])
	{
		int y=cur.first,z=cur.second;
		if(fa[y][0]==x) dfs2(y),f[x]+=f[y];
	}
	flg[eid[x]]&=(f[x]==0);
	return ;
}
int LCA(int x,int y)
{
	if(dep[x]<dep[y]) swap(x,y);
	for(int i=18; i>=0; --i)
		if(dep[fa[x][i]]>=dep[y])
			x=fa[x][i];
	if(x==y) return x;
	for(int i=18; i>=0; --i)
		if(fa[x][i]!=fa[y][i])
			x=fa[x][i],y=fa[y][i];
	return fa[x][0];
}
int find(int x){return rt[x]==x?x:(rt[x]=find(rt[x]));}
int dp[500003],es[500003],ess,ans;
// int counter=0;
void dfs3(int x,int fa=0)
{
	// ++counter;
	int prod=1;
	dp[x]=1,es[x]=1;
	for(int y:ee[x]) if(y!=fa)
		dfs3(y,x),
		es[x]+=es[y],
		dp[x]=1ll*dp[x]*(dp[y]+pw[es[y]])%p,
		prod=1ll*prod*pw[es[y]]%p;
	// printf("test %d %d\n",dp[x],prod);
	dp[x]=(1ll*dp[x]*pw[sz[x]]+p-prod)%p;
	for(int y:ee[x]) if(y!=fa)
		ans=(ans+p-1ll*dp[y]*pw[es[x]-es[y]-1]%p*pw[ess-es[x]+1]%p)%p;
	ans=(ans+1ll*dp[x]*pw[ess-es[x]+1])%p;
	// printf("%d %d %d\n",x,dp[x],ans);
	return ;
}
signed main()
{
#ifndef local
	freopen("barrack.in","r",stdin),
	freopen("barrack.out","w",stdout);
#endif
	int n=read(),m=read();
	for(int i=1; i<=n; ++i) rt[i]=i,sz[i]=1;
	for(int i=1; i<=m; ++i)
		a[i].u=read(),a[i].v=read(),
		e[a[i].u].emplace_back(a[i].v,i),
		e[a[i].v].emplace_back(a[i].u,i);
	fa[1][0]=1,dfs(1);
	for(int i=1; i<=m; ++i)
		if(!flg[i])
		{
			int x=a[i].u,y=a[i].v,z=LCA(x,y);
			++f[x],++f[y],f[z]-=2;
		}
	dfs2(1);
	for(int i=1; i<=m; ++i)
		if(!flg[i])
		{
			a[i].u=find(a[i].u),
			a[i].v=find(a[i].v);
			if(a[i].u!=a[i].v)
				sz[a[i].v]+=sz[a[i].u],
				rt[a[i].u]=a[i].v;
		}
	int R=0;
	for(int i=1; i<=m; ++i)
		if(flg[i])
			a[i].u=find(a[i].u),
			a[i].v=find(a[i].v),
			R=a[i].v,++ess,
			ee[a[i].u].push_back(a[i].v),
			ee[a[i].v].push_back(a[i].u);
#ifdef local
	assert(R);
#endif
	pw[0]=1;
	for(int i=1; i<=N; ++i) pw[i]=(pw[i-1]<<1)%p;
	dfs3(R),printf("%lld\n",1ll*ans*pw[m-ess]%p);
	return 0;
}