#include<bits/stdc++.h>
using namespace std;
const int p=1e9+7;
int n,m,x[1000005],y[1000005],po[1000005],f[25];
long long ans[500005],aa;
vector<int> edge[500005];
void dfs2(int now,int fa){
	long long tmp1=0,tmp2=1;
	for(int i=0;i<edge[now].size();i++){
		if(fa==edge[now][i])continue;
		dfs2(edge[now][i],now);
		tmp1+=ans[edge[now][i]]-1;
		tmp1%=p;
		tmp2*=(ans[edge[now][i]]+1);
		tmp2%=p;
	}
//	if(now==1)printf("%d %d\n",tmp1,tmp2);
	int l=edge[now].size()-1;
	if(fa!=0)l--;
	ans[now]=(tmp1*po[l]+tmp2*2)%p;
}
int get_fa(int r){
	if(r==f[r])return r;
	return r=get_fa(f[r]);
}
void merge(int r,int s){
	f[get_fa(r)]=s;
}
void dfs(int r){
//	printf("-%d ",r);
	for(int i=1;i<=n;i++)
		f[i]=i;
	for(int i=1;i<=m;i++)
		if(r&po[i-1]&&get_fa(x[i])!=get_fa(y[i]))
			merge(x[i],y[i]);
	int cnt[25]={};
	for(int i=1;i<=n;i++){
//		printf("%d ",get_fa(i));
		cnt[get_fa(i)]++;
	}
	for(int i=1;i<=n;i++)
		if(cnt[i])
			aa=(aa+po[cnt[i]]-1)%p;
//	printf("%d\n",aa);
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	scanf("%d%d",&n,&m);
	po[0]=1;
	for(int i=1;i<=m;i++)
		po[i]=(po[i-1]*2)%p;
	for(int i=1;i<=m;i++){
		scanf("%d%d",&x[i],&y[i]);
		edge[x[i]].push_back(y[i]);
		edge[y[i]].push_back(x[i]);
	}
	if(m==n-1){
		dfs2(1,0);
		long long a=(ans[1]-po[m])%p;
		if(a<0)a+=p;
		printf("%lld\n",a);
		return 0;
	}
	if(n<=20){
		for(int i=0;i<po[m];i++)
			dfs(i);
		printf("%lld\n",aa);
		return 0;
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}