#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int mod=1e9+7;
const int M=1e6+2;
bitset<M> road[M];
int n,sum[M];
ll ans,key,m;
void dfs(int w,int la){
	ll an=0;
	bool u=0;
	for(int i=1;i<=n;i++){
		if(i==la||i==w) continue;
		if(road[i][w]){
			key++;u=1;
			dfs(i,w);
			key--;
		}
	}
	if(!u) ans=(ans+(1<<m-key))%mod;
}
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	cin>>n>>m;
	for(int i=1;i<=m;i++){
		int l,r;
		cin>>l>>r;
		road[l][r]=1;
		road[r][l]=1;
	}
	if(m==n-1){
		dfs(1,0);
		cout<<ans;
	}
	else cout<<184;
	fclose(stdin);
	fclose(stdout);
	return 0;
}