#include <bits/stdc++.h>
#define int long long
#define mod 1000000007
using namespace std;
vector<int> q[500010];queue<int> p;int tot=0,n,t=0,m,st,ed;bool b[20],vis[20];
int fspow(int a,int b)
{
	int ans=1;
	while(b)
	{if(b&1) ans=ans*a%mod;a=a*a%mod,b>>=1;}
	return ans;
}
bool bfs(int x)
{
	p.push(x);memset(vis,0,sizeof(vis));vis[x]=true;
	while(!p.empty())
	{
		int now=p.front();p.pop();
		for(int i=0;i<q[now].size();i++) if((now!=st||q[now][i]!=ed)&&(now!=ed||q[now][i]!=st)&&!vis[q[now][i]])
		p.push(q[now][i]),vis[q[now][i]]=true;
	}
	for(int i=1;i<=n;i++) if(b[i]&&!vis[i]) return false;
	return true;
}
void dfs(int x)
{
	if(x==n+1)
	{
		int p=2*m,now=0;for(int i=1;i<=n;i++) if(b[i]){now=i;break;}if(now==0) return;
		for(int i=1;i<=n;i++) for(int j=0;j<q[i].size();j++)
		{
			st=i,ed=q[i][j];
			if(!bfs(now)) p--;
		}
		tot=(tot+fspow(2,p/2))%mod;return;
	}
	dfs(x+1);b[x]=true;dfs(x+1);b[x]=false;
}
signed main()
{
	freopen("barrack.in","r",stdin);freopen("barrack.out","w",stdout);
	int tmp1,tmp2,flag=1;scanf("%lld%lld",&n,&m);
	for(int i=1;i<=m;i++)
	{
		scanf("%lld%lld",&tmp1,&tmp2),q[tmp1].push_back(tmp2),q[tmp2].push_back(tmp1);
		if(tmp2-tmp1!=1&&tmp1-tmp2!=1) flag=0;
	}
	if(flag)
	{
		int ans=0;
		for(int i=0;i<n;i++) ans=(ans+(n-i)*fspow(2,n-i-1)%mod*fspow(2,max(i-1,0ll))%mod)%mod;
		printf("%lld",ans);return 0;
	}
	dfs(1);printf("%lld",tot);return 0;
}