#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, cnt = 0, tot = 0, top = 0, head[1000010], stc[1000010],
                vis[1000010], siz[1000010], val[1000010], sval[1000010];
long long ans = 0, suminv = 0, inv[1000010], sinv[1000010], ninv[1000010];
vector<int> vec[1000010];
struct Edge {
  int v, nxt;
} e[1000010 << 1];
inline void addEdge(int u, int v) {
  e[++cnt].v = v;
  e[cnt].nxt = head[u];
  head[u] = cnt;
}
void dfs(int u, int fa) {
  vis[u] = 1;
  stc[++top] = u;
  for (register int i = head[u]; i; i = e[i].nxt) {
    if (e[i].v == fa || vis[e[i].v] == 2) continue;
    if (vis[e[i].v] == 1) {
      tot++;
      for (register int j = top; stc[j + 1] != e[i].v; j--) {
        siz[tot]++;
        vec[tot].push_back(stc[j]);
      }
    } else
      dfs(e[i].v, u);
  }
  vis[u] = 2;
  stc[top--] = 0;
}
inline long long VV() {
  return (1ll * n * inv[1] % 1000000007 +
          1ll * (n - 1) * n % 1000000007 * inv[2] % 1000000007) %
         1000000007;
}
inline long long EE() {
  long long res = 0;
  for (register int i = 1; i <= n; i++)
    res += 1ll * val[i] * (val[i] - 1) % 1000000007;
  res %= 1000000007;
  return (1ll * m * inv[2] + res * inv[3] +
          (1ll * m * (m - 1) - res) % 1000000007 * inv[4] % 1000000007) %
         1000000007;
}
inline long long CC() {
  long long res = 0;
  for (register int i = 1; i <= tot; i++) {
    res = (res + inv[siz[i]] + inv[siz[i] - 1] * sinv[i] % 1000000007 +
           inv[siz[i]] * (1ll * suminv - inv[siz[i]] - sinv[i]) % 1000000007) %
          1000000007;
  }
  return res;
}
inline long long VE() {
  return (2ll * m * inv[2] +
          1ll * (n - 2) * m % 1000000007 * inv[3] % 1000000007) %
         1000000007;
}
inline long long VC() {
  long long res = 0;
  for (register int i = 1; i <= tot; i++) {
    res = (res + 1ll * siz[i] * inv[siz[i]] % 1000000007 +
           1ll * (n - siz[i]) * inv[siz[i] + 1] % 1000000007) %
          1000000007;
  }
  return res;
}
inline long long EC() {
  long long res = 0;
  for (register int i = 1; i <= tot; i++) {
    res = (res + 1ll * siz[i] * inv[siz[i]] % 1000000007 +
           1ll * sval[i] * inv[siz[i] + 1] % 1000000007 +
           (1ll * m - siz[i] - sval[i]) * inv[siz[i] + 2] % 1000000007) %
          1000000007;
  }
  return res;
}
int main() {
  inv[1] = 5e8 + 4;
  for (register int i = 2; i <= 1000010 - 10; i++)
    inv[i] = inv[i - 1] * inv[1] % 1000000007;
  scanf("%d%d", &n, &m);
  for (register int i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    addEdge(x, y);
    addEdge(y, x);
    val[x]++;
    val[y]++;
  }
  dfs(1, 0);
  for (register int i = 1; i <= tot; i++) {
    suminv = (suminv + inv[siz[i]]) % 1000000007;
    int sz = vec[i].size();
    for (register int j = 0; j < sz; j++) {
      ninv[vec[i][j]] = (ninv[vec[i][j]] + inv[siz[i]]) % 1000000007;
    }
  }
  for (register int i = 1; i <= tot; i++) {
    int sz = vec[i].size();
    for (register int j = 0; j < sz; j++) {
      sval[i] += val[vec[i][j]];
      sinv[i] = (sinv[i] + ninv[vec[i][j]]) % 1000000007;
    }
    sval[i] -= 2 * siz[i];
    sinv[i] = (sinv[i] - 1ll * siz[i] * inv[siz[i]] % 1000000007) % 1000000007;
  }
  long long vv = VV(), ee = EE(), cc = CC(), ve = VE(), vc = VC(), ec = EC();
  ans = 1ll * n * inv[1] - 1ll * m * inv[2];
  for (register int i = 1; i <= tot; i++)
    ans = (ans + inv[siz[i]]) % 1000000007;
  ans = 1000000007 - ans * ans % 1000000007;
  ans = (ans + vv + ee + cc - 2ll * ve - 2ll * ec + 2ll * vc) % 1000000007;
  printf("%lld", (ans + 1000000007) % 1000000007);
  return 0;
}
