#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e5+5,mod=1e9+7;
int n,m;
vector<int>g[N];
int u[N],v[N],po[N];
int f[N],sz[N],bia[N];
int find(int x){
	if(f[x]==x) return x;
	return f[x]=find(f[x]);
}
void merge(int u,int v){
	int x=find(u),y=find(v);
	if(x==y){
		bia[y]++;
		return ;
	}
	f[x]=y;
	sz[y]+=sz[x];
	bia[y]+=bia[x]+1ll;
}
int calc(int d,int b){
	return (po[d+b]-po[b]+mod)%mod;
}
int vis[N],fl[N],sta[N];
void solve40pts(){
	int ans=calc(n,m);
	
	int top=0;
	for(int i=1;i<=m;i++){
		for(int j=1;j<=n;j++) f[j]=j;
		for(int j=1;j<=m;j++){
			if(i==j) continue;
			merge(u[j],v[j]);
		}
		for(int j=2;j<=n;j++){
			if(find(j)!=find(j-1)){
				sta[++top]=i;
//				cout<<i<<"\n";
				break;
			}
		}
	}
//	cout<<"\n";
	for(int s=1;s<(1ll<<top);s++){
		memset(vis,0,sizeof(vis));
		memset(fl,0,sizeof(fl));
		for(int i=1;i<=n;i++) sz[i]=1,bia[i]=0,f[i]=i;
		for(int i=1;i<=top;i++) if((s>>(i-1))&1) fl[sta[i]]=1;
		for(int i=1;i<=m;i++){
			if(fl[i]) continue;
			merge(u[i],v[i]);
		}
		vector<int>t;
		for(int i=1;i<=n;i++){
			if(vis[find(i)]) continue;
			else t.push_back(find(i)),vis[find(i)]=1;
		}
		if(t.size()==1) continue;
		int res=1ll;
		for(auto it:t){
//			cout<<it<<" ";
			res=res*calc(sz[it],bia[it])%mod;
		}
//		cout<<res<<"\n";
		ans=(ans-res+mod)%mod;
	}
	cout<<ans<<"\n";
}
void solve25pts(){
	
}
void ____(){
	cin>>n>>m;
	po[0]=1ll;
	for(int i=1;i<=n+m;i++) po[i]=po[i-1]*2ll%mod;
	for(int i=1;i<=m;i++){
		cin>>u[i]>>v[i];
		g[u[i]].push_back(v[i]);
		g[v[i]].push_back(u[i]);
	}
//	if(n<=3000){
		solve40pts();
//	}
//	if(n>m){
//		solve25pts();
//	}
	return ;
}
signed main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	int T=1;
//	cin>>T;
	while(T--) ____();
}
/*
3 2
1 2
1 3
*/
