#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int v = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    v = v * 10 + c - '0';
    c = getchar();
  }
  return v * f;
}
const int Maxn = 500005;
const long long mod = 1e9 + 7;
int n, m;
vector<int> G[Maxn];
vector<int> nG[Maxn];
int dfn[Maxn], low[Maxn], kc, kd;
int st[Maxn], ko;
long long qp(long long x, long long p) {
  long long ret = 1;
  while (p) {
    if (p & 1) ret = ret * x % mod;
    p >>= 1;
    x = x * x % mod;
  }
  return ret;
}
long long inv(long long x) { return qp(x, mod - 2); }
void dfs(int x, int p) {
  dfn[x] = ++kc;
  low[x] = dfn[x];
  st[ko++] = x;
  for (int i = 0; i < G[x].size(); i++) {
    int v = G[x][i];
    if (v == p) continue;
    if (dfn[v]) {
      low[x] = min(low[x], dfn[v]);
    } else {
      dfs(v, x);
      if (low[v] >= dfn[x]) {
        vector<int> tmp;
        while (1) {
          tmp.push_back(st[ko - 1]);
          ko--;
          if (st[ko] == v) break;
        }
        tmp.push_back(x);
        if (tmp.size() > 2) {
          int id = ++kd;
          for (int j = 0; j < tmp.size(); j++) {
            nG[id].push_back(tmp[j]);
            nG[tmp[j]].push_back(id);
          }
        } else {
          nG[v].push_back(x);
          nG[x].push_back(v);
        }
      } else {
        nG[v].push_back(x);
        nG[x].push_back(v);
      }
      low[x] = min(low[x], low[v]);
    }
  }
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  kd = n;
  dfs(1, -1);
  long long Ex = 1ll * n * inv(2) % mod - 1ll * m * inv(4) % mod;
  long long Ec = 0;
  for (int i = n + 1; i <= kd; i++) {
    int sz = nG[i].size();
    long long v = inv(2);
    v = qp(v, sz);
    Ec += v;
  }
  Ec %= mod;
  Ex += Ec;
  Ex = (Ex % mod + mod) % mod;
  long long Evv = 0, Eee = 0, Ecc = 0, Evc = 0, Eve = 0, Eec = 0;
  Evv = 1ll * n * (n - 1) % mod * inv(4) % mod;
  Evv += 1ll * n * inv(2);
  Evv %= mod;
  Eee = 1ll * m * (m - 1) % mod * inv(16) % mod;
  Eee += 1ll * m * inv(4);
  Eee %= mod;
  long long i16 = inv(16), i8 = inv(8);
  for (int i = 1; i <= n; i++) {
    int Sz = G[i].size();
    long long ch = 1ll * Sz * (Sz - 1);
    Eee -= ch * i16;
    Eee += ch * i8;
    Eee = (Eee % mod + mod) % mod;
  }
  Eve = 1ll * m * (n - 2) % mod * inv(8) % mod;
  Eve += 1ll * m * 2 % mod * inv(4) % mod;
  for (int i = n + 1; i <= kd; i++) {
    int Sz = nG[i].size();
    long long ivs = qp(inv(2), Sz), ivs1 = qp(inv(2), Sz + 1);
    Evc += 1ll * (n - Sz) * ivs1;
    Evc += 1ll * Sz * ivs;
    Evc %= mod;
    Eec += 1ll * Sz * ivs;
    int tot = 0;
    for (int j = 0; j < nG[i].size(); j++) {
      int v = nG[i][j];
      tot += G[v].size() - 2;
    }
    Eec += 1ll * tot * ivs1;
    Eec += 1ll * (m - tot - Sz) * qp(inv(2), Sz + 2);
    Eec %= mod;
  }
  Ecc = Ec * Ec % mod;
  for (int i = n + 1; i <= kd; i++) {
    int sz = nG[i].size();
    long long v = inv(2);
    v = qp(v, sz);
    Ecc -= v * v;
    Ecc += v;
    Ecc = (Ecc % mod + mod) % mod;
  }
  for (int i = 1; i <= n; i++) {
    long long totv = 0;
    for (int j = 0; j < nG[i].size(); j++) {
      int v = nG[i][j];
      if (v > n) {
        long long T = qp(inv(2), nG[v].size());
        totv += T;
      }
    }
    totv %= mod;
    for (int j = 0; j < nG[i].size(); j++) {
      int v = nG[i][j];
      if (v > n) {
        long long T = qp(inv(2), nG[v].size());
        Ecc -= T * (totv - T);
        Ecc += 2 * T * (totv - T);
        Ecc %= mod;
      }
    }
  }
  Ecc = (Ecc % mod + mod) % mod;
  long long Exx = Ecc + Evv + Eee + 2 * Evc - 2 * Eve - 2 * Eec;
  Exx = (Exx % mod + mod) % mod;
  long long ans = Exx - Ex * Ex;
  ans = (ans % mod + mod) % mod;
  printf("%lld\n", ans);
  return 0;
}
