#include<bits/stdc++.h>
using namespace std;
#define int long long
const int mod=1e9+7;
const int o=1e6+3;
int q=1,w,s[o],b[o],v[o],n,m,p[o],f[o],ans;
vector<int> a[o];
int qwq(int x,int y){
	int z=1;
	while (y){
		if (y&1) z=z*x%mod;
		y>>=1,x=x*x%mod;
	}
	return z;
}
void dfs1(int x,int y){
	if (w==q) return;
	if (x!=s[q]) p[x]=1;
	for (int i=0;i<a[x].size();i++){
		if (a[x][i]==0) continue;
		if (a[x][i]==s[w+1]){
			b[s[q]]+=(x!=s[q])*b[x],w++,dfs1(a[x][i],x);
		}else if (a[x][i]!=s[q]&&s[q]!=x&&a[x][i]!=y) a[s[q]].push_back(a[x][i]),a[a[x][i]].push_back(s[q]);
		if (s[q]!=x) a[x][i]=0;
	}
}
void dfs(int x,int y){
	if (v[x]){
		for (int i=q-1;i>=1;i--)
			if (s[i]==x){
				w=i;
				dfs1(x,s[i-1]);
				break;
			}
		for (int i=0;i<a[x].size();i++)
			if (p[a[x][i]]) a[x][i]=0;
		return;
	}
	for (int i=0;i<a[x].size();i++)
		if (a[x][i]!=y&&a[x][i]) s[++q]=a[x][i],v[x]=1,dfs(a[x][i],x),v[x]=0,q--;
}
void dfs2(int x,int y){
	for (int i=0;i<a[x].size();i++)
		if (a[x][i]&&a[x][i]!=y) dfs2(a[x][i],x),f[x]+=f[a[x][i]];
}
void dfs3(int x,int y){
	for (int i=0;i<a[x].size();i++)
		if (a[x][i]&&a[x][i]!=y) dfs3(a[x][i],x);
	if (x!=1){
		int h=f[x],l=f[1]-f[x];
		if (h==1) h=0;
		if (l==1) l=0;
		ans=(ans+(qwq(2,h)-1+mod)%mod*qwq(2,h)%mod+(qwq(2,l)-1+mod)%mod*qwq(2,l)%mod)%mod;
		if ((!h)&&(!l)) ans++;
	}
}
signed main(){
  freopen("barrack.in","r",stdin);
  freopen("barrack.out","w",stdout);
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin>>n>>m;
  for (int i=1,x,y;i<=m;i++)
		cin>>x>>y,a[x].push_back(y),a[y].push_back(x),b[i]=1;
	s[1]=1;
	dfs(1,0);
	for (int i=1;i<=n;i++)
		f[i]=b[i];
	dfs2(1,0);
	dfs3(1,0);
//	for (int i=1;i<=n;i++)
//		for (int j=0;j<a[i].size();j++)
//			if (a[i][j]) cout<<i<<" "<<a[i][j]<<"\n";
	int g=1;
	for (int i=1;i<=n;i++)
		if (p[i]) g=0; 
	cout<<((qwq(2,m)-1+mod)%mod*qwq(2,n)%mod-ans+g*n+mod)%mod;
  return 0;
}
