#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int power(int a, int b) {
    long long res = a, ans = 1;
    for (; b; b >>= 1, res = res * res % mod) if (b & 1) ans = ans * res % mod;
    return ans;
}
int n, m;
vector <int> e[500010], son[500010];
int dfn[500010], low[500010], dfsnow, id[500010], idcnt, sta[500010], top;
int idsz[500010];
void tarjan(int u, int fa) {
    dfn[u] = low[u] = ++dfsnow;
    sta[++top] = u;
    for (auto v : e[u]) {
        if (v == fa) {
            fa = 0;
            continue;
        }
        if (dfn[v]) low[u] = min(low[u], dfn[v]);
        else tarjan(v, u), low[u] = min(low[u], low[v]);
    }
    if (low[u] == dfn[u]) {
        ++idcnt;
        do id[sta[top]] = idcnt, idsz[idcnt]++; while (sta[top--] != u);
    }
}
int dp[500010][2], sz[500010];
int ans;
void dfs(int cur, int fa) {
    dp[cur][0] = 1;
    sz[cur] = 1;
    int d = power(2, idsz[cur]) - 1;
    for (auto v : son[cur]) if (v != fa) {
        dfs(v, cur);
        sz[cur] += sz[v];
        dp[v][0] = dp[v][0] * 2 % mod;
        dp[cur][1] = (1ll * dp[cur][1] * (dp[v][0] + dp[v][1]) + 1ll * dp[cur][0] * dp[v][1]) % mod;
        dp[cur][0] = 1ll * dp[cur][0] * dp[v][0] % mod;
    }
    dp[cur][1] = (dp[cur][1] + 1ll * d * (dp[cur][1] + dp[cur][0])) % mod;
    ans = (ans + 1ll * dp[cur][1] * power(2, max(idcnt - sz[cur] - 1, 0))) % mod;
}
int main() {
    freopen("barrack.in", "r", stdin);
    freopen("barrack.out", "w", stdout);
    scanf("%d%d", &n, &m);
    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);
    }
    tarjan(1, 0);
    for (int i = 1; i <= n; i++)
        for (auto j : e[i]) if (id[i] != id[j]) son[id[i]].push_back(id[j]);
    dfs(1, 0);
    cout << 1ll * ans * power(2, m - idcnt + 1) % mod << endl;
}