#include<bits/stdc++.h>
using namespace std;
#define fo(v, a, b) for(int v = a; v <= b; v++)
#define fr(v, a, b) for(int v = a; v >= b; v--)
#define cl(a, v) memset(a, v, sizeof(a))

typedef long long ll;

const ll P = 1e9 + 7;
const int N = 5e5 + 10, M = 1e6 + 10;

int n, m; vector<int> g[N], g2[N];
struct edge {  int u, v;  } e[M];

int dfn[N], low[N], tot, bel[N], cnt;
int st[N], top; bool ins[N];
void tarjan(int x, int fa) {
    dfn[x] = low[x] = ++tot, st[++top] = x, ins[x] = true;
    for(int y : g[x]) if(y != fa) {
        if(!dfn[y]) {
            tarjan(y, x), low[x] = min(low[x], low[y]);
            if(low[y] > dfn[x]) {
                cnt++;
                while(st[top] != y)
                    ins[st[top]] = false, bel[st[top]] = cnt, top--;
                ins[st[top]] = false, bel[st[top]] = cnt, top--;
            }
        } else if(ins[y])
            low[x] = min(low[x], dfn[y]);
    }
}

ll pw2[N], rest; int siz[N];
ll dp[N][3], tmp[3], ans;

inline void add(ll &x, ll y) {
    x = (x + y) % P;
}

void dfs(int x, int fa) {
    dp[x][0] = 1, dp[x][2] = (pw2[siz[x]] + P - 1) % P;
    for(int y : g2[x]) if(y != fa) {
        dfs(y, x);
        fo(i,0,2) tmp[i] = dp[x][i], dp[x][i] = 0;
        add(dp[x][0], tmp[0] * dp[y][0] % P * 2LL % P);
        add(dp[x][1], tmp[0] * dp[y][1] % P * 2LL % P);
        add(dp[x][1], tmp[0] * dp[y][2] % P);
        add(dp[x][2], tmp[0] * dp[y][2] % P);
        add(dp[x][1], tmp[1] * dp[y][0] % P * 2LL % P);
        add(dp[x][2], tmp[2] * dp[y][0] % P * 2LL % P);
        add(dp[x][2], tmp[2] * dp[y][2] % P);
    }
}

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

    cin >> n >> m;
    fo(i,1,m) {
        int u, v; scanf("%d%d", &u, &v);
        g[u].push_back(v), g[v].push_back(u);
        e[i].u = u, e[i].v = v;
    }
    pw2[0] = 1; fo(i,1,n) pw2[i] = pw2[i - 1] * 2 % P;

    tarjan(1, 0), cnt++;
    while(top) ins[st[top]] = false, bel[st[top]] = cnt, top--;
    fo(i,1,n) siz[bel[i]]++;

    // printf("cnt = %d\n", cnt);
    // fo(i,1,n) printf("%d ", bel[i]);
    // puts("");

    rest = 1;
    fo(i,1,m) {
        if(bel[e[i].u] == bel[e[i].v]) rest = rest * 2 % P;
        else {
            int x = bel[e[i].u], y = bel[e[i].v];
            g2[x].push_back(y), g2[y].push_back(x);
        }
    }

    dfs(1, 0), ans = (dp[1][1] + dp[1][2]) % P;
    printf("%lld\n", ans * rest % P);

    return 0;
}