#include <iostream>
#include <cstdio>
#include <stack>
#include <vector> 
#include <algorithm>

constexpr int N = 500005;
constexpr int p = 1000000007;

int add(int x, int y) { return (x += y) >= p ? x - p : x; }
int sub(int x, int y) { return (x -= y) < 0 ? x + p : x; }
int mul(int x, int y) { return static_cast<unsigned long long>(x) * y % p; }
int power(int x, int y) { int ans = 1; for (; y; y >>= 1) { if (y & 1) ans = mul(ans, x); x = mul(x, x); } return ans; } 
int n, m;
struct edge {
    int x, y;
} e[N << 1];
std::vector<int> v[N], g[N];
int cnt, tot;
int dfn[N], low[N];
int bl[N], cnt1[N];
std::stack<int> stk;
bool vis[N];

void tarjan(int x, int fa) {
    dfn[x] = low[x] = ++cnt;
    stk.push(x);
    for (int i : v[x])
        if (i != fa) {
            if (!dfn[i]) {
                tarjan(i, x);
                low[x] = std::min(low[x], low[i]);
            } else if (!vis[i]) low[x] = std::min(low[x], dfn[i]);
        }
    if (dfn[x] == low[x]) {
        ++tot;
        int t; do {
            t = stk.top();
            stk.pop();
            vis[t] = true;
            ++cnt1[tot];
            bl[t] = tot;
        } while (t != x);
    }
}

int ans;
int sz[N], f[N];

void dfs(int x, int fa) {
    f[x] = 1;
    for (int i : g[x])
        if (i != fa) {
            dfs(i, x);
            f[x] = mul(f[x], add(f[i], power(2, sz[i])));
            sz[x] += sz[i];
        }
    ans = add(ans, mul(mul(f[x], sub(power(2, cnt1[x]), 1)), power(2, tot - 1 - sz[x])));
    f[x] = sub(mul(f[x], power(2, cnt1[x])), power(2, sz[x]));
    ++sz[x];
}

int main() {
    freopen("barrack.in", "r", stdin);
    freopen("barrack.out", "w", stdout);
    std::ios::sync_with_stdio(false), std::cin.tie(nullptr);
    std::cin >> n >> m;
    for (int i = 1, x, y; i <= m; ++i) {
        std::cin >> x >> y;
        e[i].x = x, e[i].y = y;
        v[x].push_back(y);
        v[y].push_back(x);
    }
    tarjan(1, 0);
    for (int i = 1; i <= m; ++i)
        if (bl[e[i].x] != bl[e[i].y]) {
            g[bl[e[i].x]].push_back(bl[e[i].y]);
            g[bl[e[i].y]].push_back(bl[e[i].x]);
        }
    dfs(1, 0);
    std::cout << mul(ans, power(2, m - tot + 1)) << '\n';
    return 0;
}
