#include<bits/stdc++.h>
using namespace std;
int n,m;
const int N=5e5+50,M=1e6+50,mod=1e9+7;
vector<int>v[N],v2[N],vv[N];
int x[M],y[M],len;
bool pd[M];
int dfn[N],lowlow[N];
int power2[N+M];
int dee=0;
void dfs(int a,int fa){
//	cout<<a<<":"<<fa<<endl;
	dfn[a]=lowlow[a]=++len;
	for(int i=0;i<v[a].size();i++){
		if(v[a][i]==fa)continue;
		if(dfn[v[a][i]]){
			lowlow[a]=min(lowlow[a],dfn[v[a][i]]);
		}
		else{
			dfs(v[a][i],a);
			lowlow[a]=min(lowlow[a],lowlow[v[a][i]]);
			if(lowlow[v[a][i]]>dfn[a]){
				pd[v2[a][i]]=1;
			}
		}
	}
	return;
}
int idx[N],cnt,sum[N];
void dfs2(int a){
	sum[cnt]++;
	idx[a]=cnt;
	for(int i=0;i<v[a].size();i++){
		if(idx[v[a][i]]>0||pd[v2[a][i]])continue;
		else{
			dfs2(v[a][i]);
		}
	}
	return;
}
int f[N],ans;
int siz[N];
void dfs3(int a,int fa){
//	if(vv[a].size()==1)cout<<a<<":"<<vv[a].size()<<endl;
	siz[a]=1;
	int cnt=1,cntt=0,cnttt=0,cnt3=1;
	for(int i=0;i<vv[a].size();i++){
		if(vv[a][i]==fa)continue;
		dfs3(vv[a][i],a);
		cnt=((cnt*1ll*f[vv[a][i]])%mod+(cnt*1ll*power2[siz[vv[a][i]]])%mod)%mod;
//		cnt3=(cnt3*1ll*power2[siz[vv[a]]])
//		if(a==1)cout<<cnt<<":";
		siz[a]+=siz[vv[a][i]];
	}
	for(int i=0;i<vv[a].size();i++){
		if(vv[a][i]==fa)continue;
		cntt=(cntt+f[vv[a][i]]*1ll*power2[siz[a]-siz[vv[a][i]]-1])%mod;
//		dfs3(vv[a][i],a);
//		cnt=((cnt*1ll*f[vv[a][i]])%mod+(cnt*1ll*power2[siz[vv[a][i]]])%mod)%mod;
////		if(a==1)cout<<cnt<<":";
//		siz[a]+=siz[v[a][i]];
		cnttt++;
	}
	cntt=(cntt+power2[siz[a]-1])%mod;
	f[a]=((cnt*1ll*power2[sum[a]]-power2[siz[a]-1])%mod+mod)%mod;
//	if(cnt==power2[siz[a]-1])cout<<-1;
//	if(a==1)ans=(ans+f[a])%mod;
	ans=((ans+((cnt*1ll*(power2[sum[a]]-1))%mod)*1ll*(power2[::cnt-siz[a]]))%mod+mod)%mod;
	ans=((ans+(((cnt-cntt)%mod+mod)%mod)*1ll*power2[::cnt-siz[a]])%mod)%mod;
//	cout<<a<<" "<<f[a]<<" "<<ans<<" "<<cnt<<" "<<power2[sum[a]]-1<<endl;
	return;
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	cin>>n>>m;
	power2[0]=1;
	for(int i=1;i<=n+m;i++)power2[i]=(power2[i-1]*2)%mod;
	for(int i=1;i<=m;i++){
		scanf("%d%d",&x[i],&y[i]);
		v[x[i]].push_back(y[i]);
		v[y[i]].push_back(x[i]);
		v2[x[i]].push_back(i);
		v2[y[i]].push_back(i);
	}
	dfs(1,0);
//	for(int i=1;i<=n;i++){
//		cout<<lowlow[i]<<" ";
//	}
//	cout<<endl;
	for(int i=1;i<=n;i++){
		if(!idx[i]){
			cnt++;
			dfs2(i);
		}
	}
	int acx=0;
	for(int i=1;i<=m;i++){
		if(pd[i]){
			vv[idx[x[i]]].push_back(idx[y[i]]);
			vv[idx[y[i]]].push_back(idx[x[i]]);
		}
		else acx++;
	}
//	sum[1]=2;
//	sum[2]=3;
	dfs3(1,0);
//	cout<<m<<" "<<cnt<<" "<<n<<endl;
	printf("%d",(ans*1ll*power2[acx])%mod);
	return 0;
}