#include<bits/stdc++.h>
using namespace std;
const int N=5e6+10;
const int mod=1e9+7;
typedef long long ll;//,fa[N][35],vis[N],d[N]
int tot,nex[2*N],head[N],ver[2*N],id[2*N],g[N];
int b[N],k,tt[N],res[N],siz[N],sta[N],dfn[N],u,top;
vector<int>s[N],e[N];
ll f[N][3];
void add(int x,int y){
	++tot;ver[tot]=y;nex[tot]=head[x];head[x]=tot;
}
void tarjan(int x,int edge){
	dfn[x]=++u;sta[++top]=x;
	for(int i=head[x];i;i=nex[i]){
		int y=ver[i]; if(i==(edge^1))continue;
		if(dfn[y]!=0&&dfn[y]<dfn[x]){
			if(!b[y]) b[y]=++k,s[k].push_back(y);
			while(top&&dfn[sta[top]]>dfn[y]){
				s[b[y]].push_back(sta[top]);
				b[sta[top]]=b[y];
				top--;
			}
		}
		else if(!dfn[y]) tarjan(y,i);
	}
	top--;
}
int find(int x){
	if(tt[x]==x) return x;
	return tt[x]=find(tt[x]);
}
ll po (int x){
	ll ans=1;ll a=2;
	while(x){
		if(x&1) ans=ans*a%mod;
		a=a*a%mod;
		x>>=1;
	}
	return ans;
}
ll ch(int x){
	return (ll)(po(s[x].size())-1+mod)%mod*po(res[x])%mod;
}
void dp(int x,int fr){
	ll r=1;siz[x]=res[x];//cout<<x<<endl;
	for(int i=0;i<e[x].size();i++){
		int y=e[x][i];  if(y==fr) continue;
		dp(y,x);
		siz[x]+=siz[y]+1;
		r=r*(f[y][0]*2+f[y][1])%mod;
		//ans=(ans+f[y][1]*2*po()%mod; //zhi xuan zhege
	}
	f[x][1]=ch(x)*r%mod;//xuanzhege
	//cout<<r<<endl;
	f[x][1]=(f[x][1]+po(res[x])*(r-po(siz[x]-res[x])+mod)%mod)%mod;    //buxuan
	//cout<<f[x][1]<<endl;
//	f[x][1]=(r+ans+po(siz[x])*ch(s[x].size()))%mod;
	f[x][0]=po(siz[x]);
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	tot=1;
	int n,m;scanf("%d%d",&n,&m);
	for(int i=1,u,v;i<=m;i++){
		scanf("%d%d",&u,&v);
		add(u,v);add(v,u);
	}
	tarjan(1,0);for(int i=1;i<=n;i++)if(!b[i]) b[i]=++k,s[k].push_back(i);
	for(int i=1;i<=k;i++) tt[i]=i;
	for(int i=1;i<=k;i++){
		for(int g=0;g<s[i].size();g++){
			int x=s[i][g];
			for(int j=head[x];j;j=nex[j]){
				int y=ver[j];
				if(b[x]==b[y]) res[i]++;
				else {
					int xx=find(b[x]),yy=find(b[y]);
					if(find(b[x])!=find(b[y])) {
						e[b[x]].push_back(b[y]);
						e[b[y]].push_back(b[x]);
						tt[xx]=yy;
					}
				}
			}
		};
		res[i]/=2;
	}
	dp(1,1);ll ans=f[1][1];//cout<<k;
	for(int i=2;i<=k;i++) ans=(ans+f[i][1]*po(siz[1]-siz[i])/2%mod)%mod;
	printf("%lld",ans);
}
