#include<bits/stdc++.h>
using namespace std;
const int p=1000000007;

long long ans;
int n,m,num,x[1000005],y[1000005],a[500005],l[500005],s[500005];

inline int read(){
	int x=0;
	char ch=getchar();
	while(!isdigit(ch))ch=getchar();
	while(isdigit(ch))x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return x;
}

int f[1000005];
int find(int x){
	if(f[x]==x)return(x);
	else{
		f[x]=find(f[x]);
		return(f[x]);
	}
}

long long add(int x){
	if(x==0)return(1);
	if(x==1)return(2);
	long long mid=add(x/2);
	if(x%2==0)return((mid*mid)%p);
	else return((((mid*mid)%p)*2)%p);
}

int ln1,q[1000005],hd[500005],ne[1000005];
void addnum1(int x,int y){
	ln1++;
	q[ln1]=y;
	ne[ln1]=hd[x];
	hd[x]=ln1;
}

int ln2,qu[1000005],head[500005],net[1000005];
void addnum2(int x,int y){
	ln2++;
	qu[ln2]=y;
	net[ln2]=head[x];
	head[x]=ln2;
}

int b[1000005],dep[1000005],fa[1000005];
void dfs(int v,int u){
	b[v]=1;
	dep[v]=dep[u]+1;
	fa[v]=u;
	for(int i=hd[v]; i; i=ne[i]){
		if(q[i]==u)continue;
		if(b[q[i]]==0){
			b[q[i]]=1;
			dfs(q[i],v);
		}else if(dep[q[i]]>dep[v]+1){
			int t=q[i],ff=0;
			while(dep[t]>dep[v]){
				ff=find(t);
				f[ff]=v;
				t=fa[ff];
			}
		}
	}
}

int dp[500005][2];
void solve(int v,int u){
	dp[v][0]=add(l[v]);
	dp[v][1]=(add(s[v]+l[v])-dp[v][0]+p)%p;
	for(int i=head[v]; i; i=net[i]){
		if(qu[i]==u)continue;
		solve(qu[i],v);
		dp[v][1]=(1ll*dp[v][1]*dp[qu[i]][0]%p*2%p+(1ll*dp[v][1]+dp[v][0])%p*dp[qu[i]][1]%p)%p;
		dp[v][0]=1ll*dp[v][0]*dp[qu[i]][0]%p*2%p;
		l[v]=l[v]+l[qu[i]]+1;
	}
	if(u!=0)ans=(ans+1ll*dp[v][1]*add(m-l[v]-1)%p)%p;
	else ans=(ans+1ll*dp[v][1]*add(m-l[v])%p)%p;
}

int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	n=read();
	m=read();
	for(int i=1; i<=n; i++)f[i]=i;
	for(int i=1; i<=m; i++){
		x[i]=read();
		y[i]=read();
		addnum1(x[i],y[i]);
		addnum1(y[i],x[i]);
	}
	dep[0]=0;
	dfs(1,0);
	num=0;
	for(int i=1; i<=n; i++){
		int ff=find(i);
		if(a[ff]==0)a[ff]=++num;
		s[a[ff]]++;
	}
	for(int i=1; i<=m; i++){
		if(f[x[i]]==f[y[i]]){
			l[a[f[x[i]]]]++;
			continue;
		}
		addnum2(a[f[x[i]]],a[f[y[i]]]);
		addnum2(a[f[y[i]]],a[f[x[i]]]);
	}
	solve(1,0);
	cout<<ans;
}