#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int M=1e9+7,N=1e6+10;
int ver[N*2],Next[N*2],head[N],tot;
void add(int u,int v)
{
	ver[++tot]=v;
	Next[tot]=head[u];
	head[u]=tot;
}
bool md[N];
int n,m;
struct Node
{
	int x,y;
}a[N];
bool vis[N];
int cnt;
void _dfs(int x)
{
	++cnt;
	vis[x]=1;
	for(int i=head[x];i;i=Next[i])
	{
		int y=ver[i];
		if(vis[y])continue;
		_dfs(y);
	}
}
ll ans;
void calc()
{
	tot=0;
	for(int i=1;i<=n;++i)head[i]=0,vis[i]=0;
	for(int i=1;i<=m;++i)
	{
		if(md[i])
		{
			add(a[i].x,a[i].y);
			add(a[i].y,a[i].x);
		}
	}
	for(int i=1;i<=n;++i)
	{
		cnt=0;
		if(!vis[i])
		{
			_dfs(i);
			if(cnt==1)continue;
			ans+=((1ll<<cnt)%M-1+M)%M;
			ans%=M;
		}
	}
}
void dfs(int x)
{
	if(x==m+1)
	{
		calc();
		return;
	}
	md[x]=1;
	dfs(x+1);
	md[x]=0;
	dfs(x+1);
}
void solve()
{
	dfs(1);
	printf("%lld\n",(ans+n*(1ll<<m)%M)%M);
}
int main()
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;++i)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		a[i].x=x,a[i].y=y;
	}
	solve();
	return 0;
}
