#include<bits/stdc++.h>
using namespace std;
const long long mod=1e9+7;
long long ans=0,p[1000010];
int n,m,X[1000010],Y[1000010],imp[1000010],vis[1000010],c[1010][1010],flag=1;
vector<pair<int,int> >v[1000010];
void dfs(int x,int nop){
	vis[x]=1;
	for(int i=0;i<v[x].size();i++){
		int to=v[x][i].first,id=v[x][i].second;
		if(vis[to]||id==nop)continue;
		dfs(to,nop);
	}
}
int count(int x){
	int res=0;
	while(x){
		res+=x%2;
		x/=2;
	}
	return res;
}
void solve(){
	int now=0;
	for(int i=1;i<=n;i++)
	    for(int j=i+1;j<=n;j++)
		    if(imp[i]&&imp[j])now|=c[i][j];
	int qwq=m-count(now);
	ans=(ans+p[qwq])%mod;
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	scanf("%d%d",&n,&m);p[0]=1;
	for(int i=1;i<=max(n,m);i++)p[i]=p[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],i});
		v[Y[i]].push_back({X[i],i});
		flag&=(X[i]==i&&Y[i]==i+1);
	}
	if(flag){
		if(n==1)printf("1\n");
		else if(n==2)printf("5\n");
		else{
			//printf("%lld %lld ",p[n-2],p[n-2]);
			for(int i=3;i<n;i++){
				long long now=0;
				if(i==n-1)now=i;
				else now=p[n-i-1]*i%mod;
				//printf("%lld ",now);
				ans=(ans+p[i-1]*now%mod)%mod;
			}
			//printf("%d\n",n);
			printf("%lld\n",(ans+p[n-2]*3%mod+p[n-1]*n%mod)%mod);
		}
		return 0;
	}
	for(int i=1;i<=m;i++){
		for(int j=1;j<=n;j++){
			for(int k=1;k<=n;k++)vis[k]=0;
			dfs(j,i);
			for(int k=1;k<=n;k++)
			    if(!vis[k])c[j][k]|=(1<<i-1);
		}
	}
	for(int i=1;i<(1<<n);i++){
		for(int j=1;j<=n;j++){
			if(i&(1<<j-1))imp[j]=1;
			else imp[j]=0;
		}
		solve();    
	}
	//for(int i=0;i<=m;i++)printf("%d ",tot[p[i]]);
	printf("%lld\n",ans);
}