#include<bits/stdc++.h>
#define fi first
#define se second
#define mkp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rep(i, a, b) for(int i = (a); i <= (b); i++)
#define per(i, a, b) for(int i = (a); i >= (b); i--)
#define pt(x) cerr << #x << " = " << (x) << endl
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
const int N = 500000 + 5, M = 1000000 + 5, MOD = 1000000000 + 7;
int n, m, hd[N], ver[M * 2], nxt[M * 2], tot = 1;
void addedge(int u, int v) {
	ver[++tot] = v;
	nxt[tot] = hd[u]; hd[u] = tot;
}
int dfn[N], low[N], dfn_cnt;
bool bridge[M * 2];
int power(int x, int y) {
	int res = 1;
	while(y) {
		if(y & 1) res = (ll)res * x % MOD;
		x = (ll)x * x % MOD;
		y >>= 1;
	}
	return res;
}
int inv(int x) {
	return power(x, MOD - 2);
}
void tarjan(int u, int in_edge) {
	dfn[u] = low[u] = ++dfn_cnt;
	for(int i = hd[u]; i; i = nxt[i]) {
		int v = ver[i];
		if(!dfn[v]) {
			tarjan(v, i);
			low[u] = min(low[u], low[v]);
			if(low[v] > dfn[u]) bridge[i] = bridge[i ^ 1] = 1;
		}
		else if(i != (in_edge ^ 1)) low[u] = min(low[u], dfn[v]);
	}
}
vector<int> dcc[N];
int bel[N], dcc_cnt;
int cnt[N];
void dfs_dcc(int u) {
	bel[u] = dcc_cnt, dcc[dcc_cnt].pb(u);
	for(int i = hd[u]; i; i = nxt[i]) {
		int v = ver[i];
		if(bel[v] || bridge[i]) continue;
		dfs_dcc(v);
	}
}
vector<int> g[N];
int dp[N], dp2[N], siz[N], ans;
void add(int &x, int y) {
	x = (x + y) % MOD;
}
void mul(int &x, int y) {
	x = (ll)x * y % MOD;
}
void sub(int &x, int y) {
	x = (x + MOD - y) % MOD;
}
void dfs(int u, int lst) {
	dp[u] = 1;
	siz[u] = 1;
	int pro = 1;
	for(int v : g[u]) {
		if(v == lst) continue;
		dfs(v, u);
		siz[u] += siz[v];
		mul(dp[u], (dp[v] + power(2, siz[v])) % MOD);
		mul(pro, power(2, siz[v]));
	}
	int res = dp[u];
	sub(res, pro);
	for(int v : g[u]) {
		if(v == lst) continue;
		sub(res, (ll)dp[v] * pro % MOD * inv(power(2, siz[v])) % MOD);
	}
	add(ans, res);
	
	int t = power(2, (int)dcc[u].size());
//	pt(dp[u]);
	add(ans, (ll)dp[u] * (t + MOD - 1) % MOD
		   * power(2, dcc_cnt - siz[u]) % MOD);
	mul(dp[u], t);
	sub(dp[u], pro);
//	add(dp[u], (ll)(t + MOD - 1) * pro % MOD);
//	pt(dp[u]);
//	pt(power(2, dcc_cnt - siz[u]));
}
int main() {
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out", "w", stdout);
	cin >> n >> m;
	rep(i, 1, m) {
		int u, v; scanf("%d%d", &u, &v);
		addedge(u, v), addedge(v, u);
	}
	rep(i, 1, n)
		if(!dfn[i]) tarjan(i, 0);
	rep(i, 1, n)
		if(!bel[i]) dcc_cnt++, dfs_dcc(i);
	rep(u, 1, n) {
		for(int i = hd[u]; i; i = nxt[i]) {
			int v = ver[i];
			if(bel[u] == bel[v]) cnt[bel[u]]++;
			else g[bel[u]].pb(bel[v]);
		}
	}
	rep(i, 1, dcc_cnt) cnt[i] /= 2;
	dfs(1, 0);
	rep(i, 1, dcc_cnt) mul(ans, power(2, cnt[i]));
	cout << ans << endl;
	return 0;
}
/*
input
2 1
1 2
output
5

input
4 4
1 2
2 3
3 1
1 4
output
184

input
3 2
1 2
1 3

input
5 4
1 2
1 3
1 4
2 5
output
168

input
4 3
1 2
1 3
1 4
*/
