#include<bits/stdc++.h>
using namespace std;
long long mm,n,m,i,cnt,a[1000000],b[1000000],c[1000000],f[1000000],ff[1000000];
long long find(long long x){
	if (f[x]==x) return x;
	f[x]=find(f[x]); return f[x];
}
long long ksm(long long x){
	long long y;
	if (x==1) return 2;
	y=ksm(x>>1)%mm;
	if (x%2==1) return(y*y%mm*2%mm);
	return(y*y%mm);
}
void sc(long long xx){
	long long i,x,y;
	if (xx==m+1){
		for (i=1;i<=n;i++){
			f[i]=i;
			ff[i]=0;
		}
		for (i=1;i<=m;i++){
			if (c[i]==1){
				x=find(a[i]);y=find(b[i]);
				if (x!=y) f[x]=y;
			}
			for (i=1;i<=n;i++) ff[find(i)]++;
			for (i=1;i<=n;i++){
				if (ff[i]!=0){
					cnt=(cnt+ksm(f[i])-1)%mm;
				}
			}
		}
	}
	if (xx<=m){
		c[xx]=1;sc(xx+1);c[xx]=0;sc(xx+1);
	}
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	cin>>n>>m;mm=1000000007;
	for (i=1;i<=m;i++) cin>>a[i]>>b[i];
	sc(1);
	cout<<cnt;
	return 0;
}