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

template<typename T>
inline void read(T &x) {
    x = 0; char ch = getchar();
    bool f = 0;
    while (!isdigit(ch)) f |= ch == '-', ch = getchar();
    while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
    if (f) x = -x;
}

const int P = 1e9 + 7, inv2 = (P + 1) / 2;
inline void add(int &x, int y) { (x += y) >= P && (x -= P); }
inline int Add(int x, int y) { return add(x, y), x; }
inline void sub(int &x, int y) { (x -= y) < 0 && (x += P); }
inline int Sub(int x, int y) { return sub(x, y), x; }
inline void mul(int &x, int y) { x = 1ll * x * y % P; }
inline int Mul(int x, int y) { return 1ll * x * y % P; }
inline int power(int a, int b) {
    int res = 1;
    for (; b; b >>= 1, mul(a, a))
        if (b & 1) mul(res, a);
    return res;
}

const int N = 500005;
int n, m, fa[N], siz[N], tag[N], cnt, bel[N], stk[N], top;
int coef[N], dp[N], ans;
vector<int> e[N], e1[N];
bool instk[N], vis[N];

void dfs(int u) {
    vis[u] = true;
    instk[u] = true;
    stk[++top] = u;
    for (auto v : e[u]) {
        if (vis[v]) {
            if (instk[v]) ++tag[u], --tag[v];
        } else {
            e[v].erase(find(e[v].begin(), e[v].end(), u));
            fa[v] = u;
            dfs(v);
            tag[u] += tag[v];
        }
    }
    instk[u] = false;
    if (tag[u] == 0) {
        ++cnt;
        while (top) {
            int x = stk[top--];
            bel[x] = cnt;
            ++siz[cnt];
            if (x == u) break;
        }
    } 
}

void dfs1(int u) {
    int f[3];
    memset(f, 0, sizeof f);
    f[0] = 1;
    for (auto v : e1[u]) {
        dfs1(v);
        add(f[2], Mul(Add(f[2], f[1]), dp[v]));
        add(f[1], Mul(f[0], dp[v]));
    }
    dp[u] = Mul(Add(Mul(Add(f[2], f[1]), Add(coef[u], 1)), coef[u]), inv2);
    add(ans, Mul(Add(Mul(f[2], Add(coef[u], 1)), Mul(Add(f[1], f[0]), coef[u])), inv2));
}

int main() {
    freopen("barrack.in", "r", stdin);
    freopen("barrack.out", "w", stdout);

    read(n), read(m);
    for (int i = 1; i <= m; ++i) {
        int u, v; read(u), read(v);
        e[u].push_back(v);
        e[v].push_back(u);
    }

    dfs(1);
    for (int i = 2; i <= n; ++i) {
        if (tag[i] == 0) {
            int u = bel[fa[i]], v = bel[i];
            e1[u].push_back(v);
        }
    }

    for (int i = 1; i <= cnt; ++i) coef[i] = power(2, siz[i]) - 1;
    dfs1(cnt);
    printf("%d\n", Mul(ans, power(2, m + 1)));

    return 0;
}