#include <bits/stdc++.h>
#define rep(i, x, y) for (int i = x; i <= y; i++)
#define per(i, x, y) for (int i = x; i >= y; i--)
#define pb push_back
using namespace std;

typedef long long ll;
const int N = 5e5 + 10, M = 2e6 + 10, mod = 1e9 + 7;
int n, m;
int to[M], lnk[N], nxt[M], ecnt = 1, dfn[N], low[N], clk;
bool mark[M];

void Add(int &x, int y) {
  x = (x + y) % mod;
}
void Mul(int &x, int y) {
  x = 1ll * x * y % mod;
}
void Sub(int &x, int y) {
  x = ((x - y) % mod + mod) % mod;
}
int mul(int x, int y) {
  return 1ll * x * y % mod;
}
int add(int x, int y) {
  return (x + y) % mod;
}
int sub(int x, int y) {
  return ((x - y) % mod + mod) % mod;
}

void adde(int x, int y) {
  to[++ecnt] = y, nxt[ecnt] = lnk[x], lnk[x] = ecnt;
}

void dfs(int x, int fa) {
  dfn[x] = low[x] = ++clk;
  for (int i = lnk[x]; i; i = nxt[i]) {
    int y = to[i];
    if (!dfn[y]) {
      dfs(y, x);
      low[x] = min(low[x], low[y]);
      // printf("%d %d %d %d\n", x, y, dfn[x], low[y]);
      if (dfn[x] < low[y]) {
        mark[i] = mark[i ^ 1] = 1;
      }
    } else if (y != fa) {
      low[x] = min(low[x], dfn[y]);
    }
  }
}

int blo = 0, bel[N], sz[N], sze[N], pw[M];
vector<int> g[N];
void dfs2(int x) {
  bel[x] = blo;
  sz[blo] += 1;
  for (int i = lnk[x]; i; i = nxt[i]) {
    if (mark[i]) continue;
    int y = to[i];
    if (x < y) sze[blo] += 1;
    if (!bel[y]) dfs2(y);
  }
}

int f[N], szee[N];
void Dp(int x, int fa) {
  f[x] = mul(sub(pw[sz[x]], 1), pw[sze[x]]);
  szee[x] = sze[x];
  // f[x][0] = f[x][1] = 1;
  for (int i = 0; i < (int)g[x].size(); i++) {
    int y = g[x][i];
    if (y == fa) continue;
    Dp(y, x);
    szee[x] += szee[y] + 1;
    int t = 0;
    Add(t, mul(f[x], pw[szee[y] + 1]));
    Add(t, mul(f[x], f[y]));
    f[x] = t;
  }
}

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

  scanf("%d%d", &n, &m);
  pw[0] = 1;
  rep(i, 1, m) pw[i] = add(pw[i - 1], pw[i - 1]);
  rep(i, 1, m) {
    int x, y; scanf("%d%d", &x, &y);
    adde(x, y), adde(y, x);
  }
  dfs(1, 0);
  rep(i, 1, n) if (!bel[i]) {
    ++blo;
    dfs2(i);
  }
  // printf("%d\n", blo);
  // rep(i, 1, n) printf("%d ", bel[i]); puts("");
  for (int i = 2; i <= ecnt; i += 2) if (mark[i]) {
    int x = to[i], y = to[i + 1];
    x = bel[x], y = bel[y];
    g[x].pb(y), g[y].pb(x);
  }
  Dp(1, 0);
  // rep(i, 1, blo) {
  //   printf("f[%d] = %d\n", i, f[i]);
  // }
  int ans = 0;
  rep(i, 1, blo) {
    Add(ans, mul(f[i], pw[m - szee[i]]));
  }
  printf("%d\n", ans);
  return 0;
}
