#include<bits/stdc++.h>
#define int long long
#define M (1000000007)
using namespace std;
struct node{
	int to,nxt;
}s[2000020];
int head[500010],cnt;
void ad(int u,int v){
	s[++cnt].to=v;
	s[cnt].nxt=head[u];
	head[u]=cnt;
}
int j[10][10],vis[10];
void dfs(int now,int lmt){
	int v;
	vis[now]=1;
	for(int i=head[now];i;i=s[i].nxt){
		v=s[i].to;
		if(vis[v]||(1<<((i-1)/2))&lmt)continue;
		dfs(v,lmt);
	}
}
int lbt(int x){
	int a=1,p=1;
	while(!(a&x)){
		a*=2;p++;
	}return p;
}
int cl[30];
int ksm(int x){
	int ct=1;
	while(x){
		if(x%2)cl[ct]=1;
		ct++;x/=2;
	}ct--;
	int p=1;
	for(int i=ct;i;i--){
		if(cl[i])p=(p*2)%M;
		if(i>1)p=(p*p)%M;
	}return p;
}
signed main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	int n,m,u,v;
	cin>>n>>m;
	for(int i=1;i<=m;i++){
		scanf("%lld%lld",&u,&v);
		ad(u,v);
		ad(v,u);
	}
	if(n<10){
		int ans,asw=0;
		for(int i=1;i<(1<<n);i++){
			for(int j=0;j<(1<<m);j++){
				ans=0;
				for(int k=1;k<=n;k++)vis[k]=0;
				dfs(lbt(i),j);
				for(int k=1;k<=n;k++){
					ans+=vis[k]*(1<<(k-1));
				}
				if((ans&i)==i)
					asw++;
			}
		}
		cout<<asw;
		return 0;
	}
	int sum=0;
	for(int i=1;i<=n;i++){
		sum=(sum+((n-i+1)*ksm(n-i)))%M;
	}cout<<sum;
	return 0;
}