#include<bits/stdc++.h>
#define pii pair<int,int>
#define mkp make_pair
#define fi first
#define se second
#define pb push_back
#define N 4000005
#define MOD 1000000007
#define int long long
using namespace std;
int n,m,dfn[N],low[N],tim=0,siz[N],ans=0,stk[N],top=0,vis[N],col[N],bcc_cnt=0,mul,f[N];
pii edge[N];
vector<int>p[N],E[N];
int head[N],to[N],nxt[N],cnt=0;
void add_edge(int x,int y){
	to[++cnt]=y;nxt[cnt]=head[x];head[x]=cnt;
}
int ksm(int x,int p){
	int sum=1;x%=MOD;
	while(p){
		if(p&1)sum=sum*x%MOD;
		x=x*x%MOD;
		p>>=1;
	}
	return sum;
}
void tarjan(int nw,int lst){
	dfn[nw]=low[nw]=++tim;stk[++top]=nw;vis[nw]=1;
	for(int i=head[nw];i;i=nxt[i])
		if(to[i]!=lst){
			if(!dfn[to[i]]){
				tarjan(to[i],nw);
				low[nw]=min(low[nw],low[to[i]]);
			}
			else if(vis[to[i]])low[nw]=min(low[nw],dfn[to[i]]);
		}
	if(low[nw]==dfn[nw]){
		int x;bcc_cnt++;
		do{
			x=stk[top--];
			col[x]=bcc_cnt;
			vis[x]=0;
			p[bcc_cnt].pb(x);
		}while(x!=nw);
	}
}
void dfs(int nw,int lst){
	f[nw]=(ksm(2,p[nw].size())-1+MOD)%MOD;siz[nw]=1;
	for(auto v:E[nw])
		if(v!=lst){
			dfs(v,nw);siz[nw]+=siz[v];
			f[nw]=f[nw]*(f[v]+2)%MOD;
		}
	//cout<<nw<<" "<<"***"<<f[nw]<<endl;
	ans=(ans+f[nw]*ksm(2,m-siz[nw]+1)%MOD)%MOD;
}
signed main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	scanf("%lld %lld",&n,&m);
	for(int i=1,x,y;i<=m;i++){
		scanf("%lld %lld",&x,&y);edge[i]=mkp(x,y);
		add_edge(x,y);add_edge(y,x);
	}tarjan(1,0);
	for(int i=1,x,y;i<=m;i++){
		x=edge[i].fi,y=edge[i].se;
		if(col[x]!=col[y])E[col[x]].pb(col[y]),E[col[y]].pb(col[x]);
	}
	dfs(1,0);printf("%lld\n",ans);
	return 0;
}
