#include<bits/stdc++.h>
#define ll long long
using namespace std;
int const gm=6e6;
int const gm2=gm;
int const mmod=1e9+7;
int head[gm];
int cnt=0;
pair<int,int> edge[gm2];
void adde(int u,int v){
	cnt++;
	edge[cnt].first=v;
	edge[cnt].second=head[u];
	head[u]=cnt;
}
unsigned ll qing[gm2];
int zi[gm2];
bitset<gm2> usedd;
unsigned ll mi[gm2];
unsigned ll po(int y){
	return mi[y];
}
void dfs(int x){
	//cout<<x<<endl;
	usedd[x]=true;
	zi[x]=1;
	qing[x]=1;
	for(int s=head[x];s;s=edge[s].second){
		int to=edge[s].first;
		if(!usedd[to]){
			dfs(to);
			zi[x]+=zi[to];
			qing[x]*=(qing[to]+po(zi[to]));
			qing[x]%=mmod;
		}
	}
	//cout<<x<<" "<<qing[x]<<endl;
}
int r[gm2];
int cun;
vector<pair<int,int>> ve;
int ves;
int aans=0;
void dfs2(int x){
	aans+=po(cun);
	aans%=mmod;
	for(int i=x;i<ves;i++){
		int u=ve[i].first;
		int v=ve[i].second;
		r[u]--;
		r[v]--;
		if(r[u]<2){
			
		}
		dfs(x+1);
		r[u]++;
		r[v]++;
	}
}
/*ll ans5=0;
bitset<20> qq;
bitset<20> pp;
bool check(){
	for(int i=0;i<ves;i++){
		
	}
	
	return false;
}
void dfs4(int x){
	if(x>=ves){
		ans5+=check();
		ans5%=mmod;
		return;
	}
	qq[x]=0;
	dfs4(x+1);
	qq[x]=1;
	dfs4(x+1);
}
void dfs3(int x){
	if(x>n){
		dfs4(0);	
		return;
	}
	pp[x]=0;
	dfs3(x+1);
	pp[x]=1;
	dfs3(x+1);
}*/
int n,m;
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	cin>>n>>m;
	int u,v;
	for(int i=1;i<=m;i++){
		scanf("%d%d",&u,&v);
		ve.push_back({u,v});
		adde(u,v);
		adde(v,u);
	}
	ves=ve.size();
if(m==n-1){
	unsigned ll ss=0;
	mi[0]=1;
	for(int i=1;i<=n+2;i++){
		mi[i]=mi[i-1]*2;
		mi[i]%=mmod;
	}
	dfs(1);
	for(int i=1;i<=n;i++){
		ss+=qing[i]*po(n-zi[i]);
		ss%=mmod;
	}
	cout<<ss<<endl;
	return 0;
}
cout<<(ll)(pow(2,n+m))%mmod<<endl;
	/*cun=n;
	for(int i=1;i<=n;i++){
		for(int s=head[i];s;s=edge[s].second){
			r[i]+=2;
		}
	}
	dfs2(0);*/
}