#include<bits/stdc++.h>
using namespace std;
const long long P=1e9+7;
long long read() {
	long long x=0,f=1;
	char c=getchar();
	while (c<'0'||c>'9') {
		if (c=='-') f=-1;
		c=getchar();
	}
	while (c>='0'&&c<='9') {
		x=(x<<3)+(x<<1)+(c^48);
		c=getchar();
	}
	return x*f;
}
long long n,m,ans;
int cnt,hed[3005],nxt[10005],to[10005],f[3005],fl[10005],u,v;
int p[3005];
long long fq[1000005];
void add(int x,int y) {
	cnt++;
	nxt[cnt]=hed[x];
	to[cnt]=y;
	hed[x]=cnt;
}
void dfs(int v) {
	for (int i=hed[v];i!=0;i=nxt[i])
		if (p[to[i]]==0&&fl[i]==0) {
			p[to[i]]=1;
			dfs(to[i]);
		}
}
bool check() {
	for (int i=1;i<=n;i++)
		if (p[i]==0&&f[i]==1) return false;
	return true;
}
long long mo(long long x) {
	return x>=P?x-P:x;
}
int main() {
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	n=read(); m=read();
	if (n<=3000) {
		for (int i=1;i<=m;i++) {
			u=read(); v=read();
			add(u,v);
			add(v,u);
		}
		for (long long i=1;i<=(1<<n)-1;i++) {
			for (int j=0;j<n;j++)
				if (i&(1<<j)) f[j+1]=1;
					else f[j+1]=0;
			cnt=0;
			for (int j=1;j<=m;j++) {
				fl[j*2-1]=1;
				fl[j*2]=1;
				for (int k=1;k<=n;k++)
					 p[k]=0;
				for (int k=1;k<=n;k++)
					if (f[k]==1) {
						p[k]=1;
						dfs(k);
						break;
					}
				if (!check()) cnt++;
				fl[j*2-1]=0;
				fl[j*2]=0;
			}
			
			ans=(ans+(1<<(m-cnt)))%P;
		}
		printf("%lld",ans);
	} else {
		if (m=n-1) {
			fq[1]=1;
			for (long long i=2;i<=m;i++)
				fq[i]=mo(fq[i-1]*2);
			ans=(n*fq[m]%P+(n-1)*fq[m-1]%P)%P;
			for (int i=3;i<=n;i++)
				ans=(ans+(n-i+1)*fq[m-i+1]%P*fq[i-2]%P)%P;
			printf("%lld",ans);
		} else {
			fq[1]=1;
			for (long long i=2;i<=m;i++)
				fq[i]=mo(fq[i-1]*2);
			ans=fq[m]*fq[n]%P;
			printf("%lld",ans);
		}
	}
	return 0;
}