#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int SIZE = 1000005;
const ll mod = 1e9+7;
int n, m;
int head[500005], ver[SIZE*2], nxt[SIZE*2], tot;
int dfn[500005], low[500005], bl[SIZE], iid;
ll siz[SIZE], esiz[SIZE], sume[SIZE];
bool br[SIZE*2], vis[SIZE];
int tots;
vector<int> e[500005];
ll dp[SIZE], f[SIZE], ans;

inline int rd(){
	int x = 0, f = 1;
	char ch = getchar();
	while(ch < '0' || ch > '9'){
		if(ch == '-') f = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9'){
		x = (x << 1) + (x << 3) + (ch ^ 48);
		ch = getchar();
	}
	return f*x;
}

ll power(ll x, ll y){
	ll jl = 1ll;
	while(y){
		if(y & 1) jl = (jl * x) % mod;
		x = (x * x) % mod;
		y >>= 1;
	}	
	return jl;
}

struct E{
	int x, y, id;
}ee[SIZE*2];

void add(int x, int y){
	ver[++tot] = y, nxt[tot] = head[x];
	head[x] = tot;	
}

void tarjan(int x, int las){
	dfn[x] = low[x] = ++iid;
	for(int i = head[x]; i; i = nxt[i]){
		int y = ver[i];
		if(!dfn[y]){
			tarjan(y, i);
			low[x] = min(low[x], low[y]);
			if(low[y] > dfn[x]) br[i] = br[i^1] = 1;
		}
		else if(i != (las^1)) low[x] = min(low[x], dfn[y]);
	}
}

void dfs(int x){
	vis[x] = 1; bl[x] = tots, siz[tots]++;
	for(int i = head[x]; i; i = nxt[i]){
		int y = ver[i];
		if(vis[y] || br[i]) continue;
		dfs(y);
	}
}

//void dfs1(int x, int fa){
//	ll jl = 1ll, jl1 = 1ll, jl3 = 0, cc = 0;
//	sume[x] = esiz[x];
//	for(int i = 0; i < e[x].size(); i++){
//		int y = e[x][i];
//		if(y == fa) continue;
//		dfs1(y, x); cc++;
//		sume[x] = (sume[x] + sume[y] + 1) % mod;
//		jl = (jl * ((dp[y] + ((power(2ll, sume[y]) * 2ll) % mod)) % mod)) % mod;
//		jl1 = (jl1 * ((power(2ll, sume[y]) * 2ll) % mod)) % mod;
//	}
//	for(int i = 0; i < e[x].size(); i++){
//		int y = e[x][i];
//		if(y == fa) continue;
//		jl3 = (jl3 + (((jl1 * power(((power(2ll, sume[y]) * 2ll) % mod), mod-2) % mod) % mod) * dp[y] % mod)) % mod;
//	}
//	ll jl2 = ((jl - jl1) % mod + mod) % mod;
////	cout << jl1 << endl;
//	jl2 = ((jl2 - jl3) % mod + mod) % mod;
//	jl2 = (jl2 * power(2ll, esiz[x])) % mod;
////	cout << "---" << jl2 << endl;
////	cout << jl << endl;
//	jl = (jl * (((power(2ll, siz[x]) - 1ll) % mod + mod) % mod)) % mod;
//	jl = (jl * power(2ll, esiz[x])) % mod;
////	cout << "!"  << jl << endl;
////	cout << jl2 << endl;
//	if(cc > 0) dp[x] = (dp[x] + jl2) % mod;
//	dp[x] = (dp[x] + jl) % mod;
//	cout << x << " " << dp[x] << endl;
//}

void dfs1(int x, int fa){
	ll jl = 1ll, jl4 = 1, jl3 = 0;
	sume[x] = esiz[x];
	for(int i = 0; i < e[x].size(); i++){
		int y = e[x][i];
		if(y == fa) continue;
		dfs1(y, x);
		sume[x] = (sume[x] + sume[y] + 1) % mod;
		jl = (jl * (((dp[y] + f[y]) % mod + power(2ll, sume[y] + 1)) % mod)) % mod;
		jl4 = (jl4 * ((power(2ll, sume[y]) * 2ll) % mod)) % mod;
	}
	for(int i = 0; i < e[x].size(); i++){
		int y = e[x][i];
		if(y == fa) continue;
		jl3 = (jl3 + (((jl4 * power(((power(2ll, sume[y]) * 2ll) % mod), mod-2) % mod) % mod) * dp[y] % mod)) % mod;
	}
//	jl3 = (jl3 * 2) % mod;
	jl3 = (jl3 * power(2ll, esiz[x])) % mod;
//	cout << jl3 << endl;
	ans = ((ans - jl3) % mod + mod) % mod;
	ll jl1 = jl;
	jl = (jl * (((power(2ll, siz[x]) - 1ll) % mod + mod) % mod)) % mod;
	jl = (jl * power(2ll, esiz[x])) % mod;
//	jl = ((jl - power(2ll, sume[x])) % mod + mod) % mod;
	dp[x] = jl;
	jl1 = (jl1 * power(2ll, esiz[x])) % mod;
	jl1 = ((jl1 - power(2ll, sume[x])) % mod + mod) % mod;
	f[x] = jl1;
//	cout << x << " " << dp[x] << " " << f[x] << endl;
}

int main(){
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out", "w", stdout);
	n = rd(), m = rd(); tot = 1;
	for(int i = 1; i <= m; i++){
		int x = rd(), y = rd();
		add(x, y); add(y, x);
		ee[i].x = x, ee[i].y = y, ee[i].id = tot;
	}
	for(int i = 1; i <= n; i++){
		if(!dfn[i]) tarjan(i, 0);
	}
	for(int i = 1; i <= n; i++){
		if(!vis[i]){
			tots++;
			dfs(i);
		}
	}
//	cout << tots << endl; int ccc = 0;
	for(int i = 1; i <= m; i++){
		if(br[ee[i].id]){
//			cout << bl[ee[i].x] << " " << bl[ee[i].y] << endl;
//			ccc++;
			e[bl[ee[i].x]].push_back(bl[ee[i].y]);
			e[bl[ee[i].y]].push_back(bl[ee[i].x]);
		}
		else esiz[bl[ee[i].x]]++;
	}
//	cout << ccc << endl;
//	for(int i = 1; i <= tots; i++) printf("%lld %lld\n", esiz[i], siz[i]);
	dfs1(1, 0);
//	cout << ans << endl;
	for(int i = 1; i <= tots; i++){
//		cout << dp[i] * power(2ll, sume[1]-sume[i]) % mod << endl;
		ans = (ans + dp[i] * power(2ll, sume[1]-sume[i]) % mod) % mod;
		ans = (ans + f[i]) % mod;
	}
//	ans = (dp[1] + f[1]) % mod;
	printf("%lld", ans);
	return 0;
}
/*
14 17
1 2
1 4
2 4
2 11
11 14
14 13
13 12
12 11
2 5
5 6
6 3
3 2
6 10
5 7
7 9
9 8
8 7

10 12
1 2
2 3
3 4
4 1
4 10
3 6
6 8
8 7
7 6
7 9
2 5
5 3

4 3
1 2
1 3
1 4
*/

