#include <bits/stdc++.h>

#define Deb std::cerr
#define Delin Deb << "[Debug] at Line " << __LINE__
#define Debug Delin << " : "
#define Deline Delin << std::endl

namespace Mod {

template <typename Type, Type P, typename MulType>
class ModInt {
   public:
    Type x;
    using Self = ModInt<Type, P, MulType>;
    ModInt(int a = 0) : x(a) {}
    explicit operator Type() { return x; }
    friend inline Self operator+(Self a, Self b) { return (a.x += b.x) >= P ? a.x - P : a.x; }
    friend inline Self operator-(Self a, Self b) { return (a.x -= b.x) < 0 ? a.x + P : a.x; }
    friend inline Self operator*(Self a, Self b) { return MulType(a.x) * b.x % P; }
    friend inline Self &operator+=(Self &a, Self b) { return (a.x += b.x) >= P ? a.x -= P, a : a; }
    friend inline Self &operator-=(Self &a, Self b) { return (a.x -= b.x) < 0 ? a.x += P, a : a; }
    friend inline Self &operator*=(Self &a, Self b) { return a = MulType(a.x) * b.x % P; }
    template <typename ExpType>
    inline Self Pow(ExpType Exp) {
        Self Base(*this), Ans(1);
        while (Exp) {
            if (Exp & 1) Ans *= Base;
            Base *= Base, Exp >>= 1;
        }
        return Ans;
    }
    inline Self Inv() { return Pow(P - 2); }
};

};

#define templ template <typename Type1, typename Type2>
templ inline Type1 &Mid(Type1 &x, Type2 y) { return x < y ? x : x = y; }
templ inline Type1 &Mad(Type1 &x, Type2 y) { return x > y ? x : x = y; }
#undef templ

using MInt = Mod::ModInt<int, 1000000007, long long>;

const int N = 500005;
const int M = 1000005;

int n, m;
int Eu[M], Ev[M];
int Clock, Cnt, RCnt, Eize, Tize[N], Sta[N], Dfn[N], Low[N], RId[N], Size[N];

MInt Ans;
MInt Pow2[M], f[N], g[N];

std::vector<int> To[N], Ro[N];

inline void Tarjan(int u, int Fa) {
    Dfn[u] = Low[u] = ++Clock, Sta[++Cnt] = u;
    for (auto v : To[u]) {
        if (v == Fa) continue;
        if (!Dfn[v]) Tarjan(v, u);
        Mid(Low[u], Low[v]);
    }
    if (Dfn[u] == Low[u]) {
        ++RCnt;
        while (Sta[Cnt + 1] != u) 
        RId[Sta[Cnt--]] = RCnt, ++Size[RCnt];
    }
}

inline void Dfs(int u, int Fa) {
    Tize[u] = 1;
    MInt Pif = 1, Pig = 1;
    for (auto v : Ro[u]) {
        if (v == Fa) continue;
        Dfs(v, u), Pif *= f[v] + g[v], Pig *= g[v], Tize[u] += Tize[v];
    }
    g[u] = 2 * Pig, f[u] = Pif * Pow2[Size[u]] - Pig;
    Ans += (Pow2[Size[u]] - 1) * Pif * Pow2[RCnt - Tize[u]];
}

int main() {
    freopen("barrack.in", "r", stdin);
    freopen("barrack.out", "w", stdout);
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr), std::cout.tie(nullptr);
    Pow2[0] = 1;
    for (int i = 1; i < M; ++i) Pow2[i] = Pow2[i - 1] * 2;
    std::cin >> n >> m;
    for (int i = 1; i <= m; ++i) {
        std::cin >> Eu[i] >> Ev[i];
        To[Eu[i]].push_back(Ev[i]);
        To[Ev[i]].push_back(Eu[i]);
    }
    Tarjan(1, 0);
    for (int i = 1; i <= m; ++i) {
        if (RId[Eu[i]] == RId[Ev[i]]) {
            ++Eize;
        } else {
            Ro[RId[Eu[i]]].push_back(RId[Ev[i]]);
            Ro[RId[Ev[i]]].push_back(RId[Eu[i]]);
        }
    }
    Dfs(1, 0);
    std::cout << int(Ans * Pow2[Eize]) << '\n';
    return 0;
}