#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
const int N=500020;
const int M=1000020;
const ll P=1000000007;
int n, m;
vector<int> e[N];
int en[N];
int fa[N], dep[N], pre[N], sz[N];
int b[N];
ll dp[2][N];
ll mi[M];
ll ans;

inline ll Add(const ll& a, const ll& b){
	return a+b<P?a+b:a+b-P;
}

void dfs(int u){
	pre[u]=dep[u];
	sz[u]=0;
	for(auto v:e[u]){
		if(v!=fa[u]&&dep[v]!=0&&dep[v]<dep[u]){
			++en[v];
			++sz[v];
			continue;
		}else if(v==fa[u])
			continue;
		fa[v]=u;
		dep[v]=dep[u]+1;
		dfs(v);
		sz[u]+=sz[v]+1;
		if(pre[v]<=dep[u]) b[v]=0;
		else b[v]=1;
		pre[u]=min(pre[u], pre[v]);
	}
}

void work(int u){
	dp[0][u]=mi[sz[u]];
	dp[1][u]=mi[en[u]];
	for(auto v:e[u]){
		if(dep[v]<dep[u])
			continue;
		work(v);
		if(b[v]==1)
			dp[1][u]=dp[1][u]*Add(dp[0][v]*2%P, dp[1][v]);
		else
			dp[1][u]=dp[1][u]*Add(dp[0][v], dp[1][v])*2%P;
	}
	dp[1][u]=(dp[1][u]+dp[1][u]-dp[0][u]+P)%P;
}

int main(){
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out", "w", stdout);
	scanf("%d%d", &n, &m);
	mi[0]=1;
	for(int i=1; i<=m; ++i)
		mi[i]=mi[i-1]*2%P;
	for(int i=1; i<=m; ++i){
		int u, v;
		scanf("%d%d", &u, &v);
		e[u].push_back(v);
		e[v].push_back(u);
	}
	dep[1]=1;
	dfs(1);
	work(1);
	printf("%lld\n", dp[1][1]);
	return 0;
}