#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9+7;
ll read() {
    ll x = 0;
    char c = getchar();
    while ( c > '9' || c < '0' ) c = getchar();
    while ( c <= '9' && c >= '0' ) {
        x = (x<<3)+(x<<1)+(c-'0');
        c = getchar();
    }
    return x;
}
#define d read()
ll ksm( ll a, ll b ) {
    ll res = 1;
    while ( b ) {
        if ( b & 1 ) ( res *= a ) %= mod;
        ( a *= a ) %= mod;
        b >>= 1;
    }
    return res;
}
ll n, m;
vector<ll>nxt[500005];
ll low[500005], dfn[500005];
bool inst[500005];
bool vis[500005];
stack<ll>st;
ll cnt = 0;
ll qlt[500005];
ll qcnt = 0;
void tarjan( ll x, ll fa ) {
    st.push(x);
    vis[x] = inst[x] = true;
    dfn[x] = low[x] = ++cnt;
    for ( auto p : nxt[x] ) {
        if ( p == fa ) continue;
        if ( !vis[p] ) {
            tarjan(p,x);
            low[x] = min( low[x], low[p] );
        } else if ( inst[p] ) {
            low[x] = min( low[x], low[p] );
        }
    }
    if ( low[x] == dfn[x] ) {
        ++qcnt;
        while ( st.top() != x ) {
            inst[st.top()] = false;
            qlt[st.top()] = qcnt;
            st.pop();
        }
        inst[st.top()] = false;
        qlt[st.top()] = qcnt;
        st.pop();
    }
}
ll sz[500005], siz[500005];
vector <ll> qnxt[500005];
ll ans = 0;
pair <ll, ll> dfs( ll x, ll fa ) {
    ll f0 = 1;
    ll f01 = ksm(2,sz[x]);
    ll o = 0;
    siz[x] = 1;
    for ( auto p : qnxt[x] ) {
        if ( p == fa ) continue;
        pair <ll,ll> res = dfs(p,x);
        siz[x] += siz[p];
        ( f0 *= ( 2 * res.second ) ) %= mod;
        ( f01 *= ( 2 * res.second + res.first ) ) %= mod;
        f01 %= mod;
    }
    ( f01 += ( mod - f0 ) ) %= mod;
    if ( qcnt != siz[x] ) {
        ( ans += f01 * ksm(2,qcnt-siz[x]-1) ) %= mod;
    } else {
        ( ans += f01 ) %= mod;
    }
    return make_pair(f01,f0);
}
int main() {
    freopen("barrack.in","r",stdin);
    freopen("barrack.out","w",stdout);
    n = d, m = d;
    for ( ll i = 1,u,v; i <= m; ++i ) {
        u = d, v = d;
        nxt[u].push_back(v);
        nxt[v].push_back(u);
    }
    tarjan(1,0);
    ll tmp_cnt = 0;
    for ( ll i = 1 ; i <= n ; ++i ) {
        sz[qlt[i]]++;
        for ( auto x : nxt[i] ) {
            if ( qlt[i] != qlt[x] ) {
                qnxt[qlt[i]].push_back(qlt[x]);
                ++tmp_cnt;
            }
        }
    }
    dfs(1,0);
    ans *= ksm(2,m-qcnt+1);
    ans %= mod;
    printf("%lld\n",ans);
}
// 居然调出来了