#include <bits/stdc++.h>
inline int read() {
  char c = getchar();
  int f = 1, ans = 0;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    ans = ans * 10 + (c - '0');
    c = getchar();
  }
  return ans * f;
}
using namespace std;
const long long p = 1000000007, I2 = (p + 1) / 2;
struct edge {
  int nxt, to;
  edge(int nxt = 0, int to = 0) : nxt(nxt), to(to){};
} e[500005 * 2];
int TOT = 1, head[500005];
inline void add_edge(int x, int y) {
  e[++TOT] = edge(head[x], y);
  head[x] = TOT;
}
long long n, m, k, cnt_e[500005], cnt_c[500005], cnt_ce[500005], size[500005],
    sum[500005], sum2[500005];
int vis[500005], fa[500005], dep[500005];
vector<int> vct[500005];
void dfs(int x, int _fa) {
  fa[x] = _fa;
  dep[x] = dep[_fa] + 1;
  vis[x] = 1;
  for (int i = head[x]; i; i = e[i].nxt) {
    int y = e[i].to;
    if (y == _fa) continue;
    if (vis[y]) {
      if (dep[x] < dep[y]) continue;
      ++k;
      for (int z = x; z != y; z = fa[z]) vct[k].push_back(z);
      vct[k].push_back(y);
    } else
      dfs(y, x);
  }
}
inline long long sqr(long long x) { return x * x % p; }
inline long long ksm(long long x, int b) {
  long long ans = 1;
  while (b) {
    if (b & 1) (ans *= x) %= p;
    (x *= x) %= p;
    b >>= 1;
  }
  return ans;
}
inline long long E() {
  long long ans = (n * I2 - m * sqr(I2)) % p;
  for (int i = 1; i <= k; i++) (ans += ksm(I2, size[i])) %= p;
  return ans;
}
inline long long VV() { return (sqr(n) + n) * sqr(I2) % p; }
inline long long EE() {
  long long ans = (sqr(m) + m) % p;
  for (int i = 1; i <= n; i++) (ans += sqr(cnt_e[i])) %= p;
  return ans * sqr(sqr(I2)) % p;
}
inline long long CC() {
  long long ans = 0;
  for (int i = 1; i <= k; i++) (ans += ksm(I2, size[i])) %= p;
  (ans += sqr(ans)) %= p;
  for (int i = 1; i <= k; i++) (ans -= ksm(I2, size[i] * 2)) %= p;
  for (int i = 1; i <= n; i++) (ans += sqr(sum[i]) - sum2[i]) %= p;
  return ans;
}
inline long long VC() {
  long long ans = 0;
  for (int i = 1; i <= k; i++)
    (ans += ksm(I2, size[i] + 1) * (size[i] + n)) %= p;
  return ans;
}
inline long long CE() {
  long long ans = 0;
  for (int i = 1; i <= k; i++)
    (ans += ksm(I2, size[i]) * (size[i] + cnt_ce[i] * I2 % p +
                                (m - size[i] - cnt_ce[i]) * sqr(I2) % p)) %= p;
  return ans;
}
inline long long VE() { return (n + 2) * m % p * sqr(I2) % p * I2 % p; }
inline long long E2() {
  return (VV() + CC() + EE() + 2 * (VC() - VE() - CE())) % p;
}
inline long long Var() { return (E2() - sqr(E())) % p; }
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= m; i++) {
    int x = read(), y = read();
    cnt_e[x]++;
    cnt_e[y]++;
    add_edge(x, y);
    add_edge(y, x);
  }
  dfs(1, 0);
  for (int i = 1; i <= k; i++) {
    size[i] = vct[i].size();
    int S = ksm(I2, size[i]);
    for (int t = 0; t <= size[i] - 1; t++) {
      int x = vct[i][t];
      cnt_c[x]++;
      cnt_ce[i] += cnt_e[x];
      (sum[x] += S) %= p;
      (sum2[x] += sqr(S)) %= p;
    }
    cnt_ce[i] -= 2 * size[i];
  }
  printf("%d\n", (Var() + p) % p);
  return 0;
}
