#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int nex, to;
} edge[500005 << 1];
vector<pair<int, int> > v;
int E, n, m, x, y, inv[500005], head[500005], r[500005], dfn[500005], f[500005],
    dep[500005], sum[500005];
int En, Em, Ec, En2, Em2, Ec2, Enm, Enc, Emc, EX, EX2, ans;
void add(int x, int y) {
  edge[E].nex = head[x];
  edge[E].to = y;
  head[x] = E++;
}
void dfs(int k, int fa, int s) {
  dfn[k] = ++dfn[0];
  f[k] = fa;
  dep[k] = s;
  for (int i = head[k]; i != -1; i = edge[i].nex)
    if (edge[i].to != fa) {
      if (!dfn[edge[i].to])
        dfs(edge[i].to, k, s + 1);
      else {
        if (dep[edge[i].to] >= s) continue;
        int l = s - dep[edge[i].to] + 1;
        Ec = (Ec + inv[l]) % 1000000007;
        Enc =
            (Enc + 1LL * (n - l) * inv[l + 1] + 1LL * l * inv[l]) % 1000000007;
        int s_same = l;
        for (int j = k;; j = f[j]) {
          s_same = s_same + r[j] - 2;
          sum[j] = (sum[j] + inv[l]) % 1000000007;
          if (j == edge[i].to) break;
        }
        Emc = (Emc + 1LL * (m - s_same) * inv[l + 2] +
               1LL * (s_same - l) * inv[l + 1] + 1LL * l * inv[l]) %
              1000000007;
        sum[0] = (sum[0] + inv[l]) % 1000000007;
        v.push_back(make_pair(k, edge[i].to));
      }
    }
}
int main() {
  inv[0] = 1;
  for (int i = 1; i < 500005; i++)
    inv[i] = 1LL * (1000000007 + 1) / 2 * inv[i - 1] % 1000000007;
  scanf("%d%d", &n, &m);
  memset(head, -1, sizeof(head));
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
    r[x]++, r[y]++;
  }
  En = 1LL * n * inv[1] % 1000000007;
  Em = 1LL * m * inv[2] % 1000000007;
  En2 =
      (1LL * n * (n - 1) % 1000000007 * inv[2] + 1LL * n * inv[1]) % 1000000007;
  Enm =
      (1LL * m * (n - 2) % 1000000007 * inv[3] + 2LL * m * inv[2]) % 1000000007;
  for (int i = 1; i <= n; i++)
    for (int j = head[i]; j != -1; j = edge[j].nex) {
      x = i, y = edge[j].to;
      if (x < y)
        Em2 = (Em2 + 1LL * (m - r[x] - r[y] + 1) * inv[4] +
               1LL * (r[x] + r[y] - 2) * inv[3] % 1000000007 + inv[2]) %
              1000000007;
    }
  dfs(1, 0, 0);
  for (int i = 0; i < v.size(); i++) {
    x = v[i].first, y = v[i].second;
    int l = dep[x] - dep[y] + 1, s_same = inv[l];
    for (int j = x;; j = f[j]) {
      s_same =
          ((s_same + sum[j] - inv[l]) % 1000000007 + 1000000007) % 1000000007;
      if (j == y) break;
    }
    Ec2 = (Ec2 + 1LL * (sum[0] + 1000000007 - s_same) * inv[l] +
           1LL * (s_same + 1000000007 - inv[l]) * inv[l - 1] + inv[l]) %
          1000000007;
  }
  EX = ((0LL + En - Em + Ec) % 1000000007 + 1000000007) % 1000000007;
  EX2 = ((0LL + En2 + Em2 + Ec2 - 2 * Enm + 2 * Enc - 2 * Emc) % 1000000007 +
         1000000007) %
        1000000007;
  ans = (EX2 - 1LL * EX * EX % 1000000007 + 1000000007) % 1000000007;
  printf("%d", ans);
}
