#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int md=1e9+7,N=2e6+5;
int n,m,head[N],cnt,low[N],dfn[N],idx,SCC,bel[N],top,sta[N];
int pw2[N],f[N],g[N];
int siz[N],rds[N],ans;
int sum[N];
bool vis[N];
vector<int>G[500005];
struct edge{
	int to,nxt;
}e[N*2];
void dfs(int u,int p){
	vis[u]=1;
	low[u]=dfn[u]=++idx;
	sta[++top]=u;
	for(int i=head[u];i;i=e[i].nxt)
		if(e[i].to!=p){
			if(!dfn[e[i].to]){
				dfs(e[i].to,u);
				low[u]=min(low[u],low[e[i].to]);
			}else if(vis[e[i].to]){
				low[u]=min(low[u],dfn[e[i].to]);
			}
		}
	if(low[u]==dfn[u]){
		++SCC;
		int v;
		do{
			v=sta[top--];
			vis[v]=0;
			bel[v]=SCC;
			++siz[SCC];
		}while(v!=u);
	}
}
void DFS(int u,int p){
	sum[u]=rds[u];
	int F[3];
	F[2]=(pw2[siz[u]]-1LL)*pw2[rds[u]]%md;
	F[0]=pw2[rds[u]];
	F[1]=0;
	for(int v:G[u]){
		if(v==p)continue;
		DFS(v,u);
		int nF0=(LL)F[0]*g[v]%md;
		int nF1=((LL)F[1]*g[v]+(LL)F[0]*f[v])%md;
		int nF2=((LL)F[2]*(f[v]+g[v])+(LL)F[1]*f[v])%md;
		F[0]=nF0;
		F[1]=nF1;
		F[2]=nF2;
		sum[u]+=sum[v]+1;
	}
	g[u]=F[0]*2%md;
	ans=(ans+(LL)F[2]*pw2[m-sum[u]])%md;
	f[u]=(F[1]+F[2])%md;
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin>>n>>m;
	for(int i=1;i<=m;++i){
		int u,v;
		cin>>u>>v;
		e[++cnt]=(edge){v,head[u]},head[u]=cnt;
		e[++cnt]=(edge){u,head[v]},head[v]=cnt;
	}
	dfs(1,0);
	for(int u=1;u<=n;++u)
		for(int i=head[u];i;i=e[i].nxt)
			if(e[i].to>u){
				if(bel[u]==bel[e[i].to])++rds[bel[u]];
				else{
					G[bel[u]].emplace_back(bel[e[i].to]);
					G[bel[e[i].to]].emplace_back(bel[u]);
				}
			}
	for(int i=*pw2=1;i<=n+m;++i)pw2[i]=pw2[i-1]*2%md;
	DFS(1,0);
	cout<<ans<<'\n';
	return 0;
}
