#include<bits/stdc++.h>
using namespace std;

template<class T>inline void read(T&x){
	char c,last=' ';
	while(!isdigit(c=getchar()))last=c;
	x=c^48;
	while(isdigit(c=getchar()))x=(x<<3)+(x<<1)+(c^48);
	if(last=='-')x=-x;
}

const int MAXN=5e5+7,P=1e9+7;
int n,m;
vector<int>e[MAXN];

namespace Brute{
	int f[50];
	int u[50],v[50];
	int _v[50],_e[50];
	int ans;
	int sf(int x){
		return f[x]==x?x:f[x]=sf(f[x]);
	}
	void check(){
		for(int i=1;i<=m;++i){
			if(_e[i])continue;
			for(int j=1;j<=n;++j)f[j]=j;
			for(int j=1;j<=m;++j){
				if(j==i)continue;
				if(sf(u[j])!=sf(v[j]))f[sf(u[j])]=sf(v[j]);
			}
			vector<int>v;
			for(int j=1;j<=n;++j)if(_v[j])v.push_back(sf(j));
			for(int j=1;j<(int)v.size();++j){
				if(v[j]!=v[j-1])return;
			}
		}
		++ans;
	}
	void dfsE(int x){
		if(x>m){
			check();
			return;
		}
		_e[x]=0;
		dfsE(x+1);
		_e[x]=1;
		dfsE(x+1);
	}
	void dfsV(int x,int f){
		if(x>n){
			if(f)dfsE(1);
			return;
		}
		_v[x]=0;
		dfsV(x+1,f);
		_v[x]=1;
		dfsV(x+1,1);
	}
	void solve(){
		for(int i=1;i<=m;++i)read(u[i]),read(v[i]);
		dfsV(1,0);
		cout<<ans<<'\n';
	}
}

namespace Brute2{
	int f[50];
	int M[50][50];
	int u[50],v[50];
	int _e[50];
	int ans;
	int sf(int x){
		return f[x]==x?x:f[x]=sf(f[x]);
	}
	void calc(){
		for(int i=1;i<=n;++i){
			for(int j=1;j<=n;++j){
				M[i][j]=1;
			}
		}
		for(int i=1;i<=m;++i){
			if(_e[i])continue;
			for(int j=1;j<=n;++j)f[j]=j;
			for(int j=1;j<=m;++j){
				if(j==i)continue;
				if(sf(u[j])!=sf(v[j]))f[sf(u[j])]=sf(v[j]);
			}
			for(int i=1;i<=n;++i){
				for(int j=1;j<=n;++j){
					if(sf(i)!=sf(j))M[i][j]=0;
				}
			}
		}
		for(int j=1;j<=n;++j)f[j]=j;
		for(int i=1;i<=n;++i){
			for(int j=1;j<=n;++j){
				if(M[i][j]){
					if(sf(i)!=sf(j))f[sf(i)]=sf(j);
				}
			}
		}
		vector<int>cnt(n+7),pw(n+7);
		pw[0]=1;
		for(int i=1;i<=n;++i)++cnt[sf(i)],pw[i]=pw[i-1]*2ll%P;
		for(int i=1;i<=n;++i){
			ans+=(pw[cnt[i]]-1);
		}
	}
	void dfs(int x){
		if(x>m){
			calc();
			return;
		}
		_e[x]=0;
		dfs(x+1);
		_e[x]=1;
		dfs(x+1);
	}
	void solve(){
		for(int i=1;i<=m;++i)read(u[i]),read(v[i]);
		dfs(1);
		cout<<ans<<'\n';
	}
}

namespace Chain{
	void solve(){
		vector<int>pw(n+7);
		pw[0]=1;
		for(int i=1;i<=n;++i)pw[i]=pw[i-1]*2ll%P;
		int ans=1ll*n*pw[n-1]%P;
		for(int i=2;i<=n;++i){
			ans=(ans+1ll*(n-i+1)*pw[i-2]*pw[n-i]%P)%P;
		}
		cout<<ans<<'\n';
	}
}

int main()
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	read(n),read(m);
	if(m<=25){
		Brute2::solve();
		exit(0);
	}
	for(int u,v;m--;){
		read(u),read(v);
		e[u].push_back(v);
		e[v].push_back(u);
	}
	int f=1;
	for(int i=1;i<=n;++i)f&=e[i].size()<=2;
	if(f)Chain::solve();
	return 0;
}
//8 7
//1 2
//2 3
//3 4
//4 5
//5 6
//6 7
//7 8
