#include <bits/stdc++.h>
using namespace std;
template <typename T>
void maxtt(T& t1, T t2) {
  t1 = max(t1, t2);
}
template <typename T>
void mintt(T& t1, T t2) {
  t1 = min(t1, t2);
}
bool debug = 0;
int n, m, k;
string direc = "URDL";
const long long MOD2 = (long long)1000000007 * (long long)1000000007;
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int& x, int y, int mod = 1000000007) {
  x += y;
  if (x >= mod) x -= mod;
  if (x < 0) x += mod;
  assert(x >= 0 && x < mod);
}
void et(int x = -1) {
  printf("%d\n", x);
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 1000000007) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) { return y ? gcd1(y, x % y) : x; }
int u[500135], v[500135];
vector<int> mp[500135];
int lev[500135], N;
int cutid[500135], bcc[500135], ccnt, bcnt;
vector<int> vb[500135];
stack<int> s;
int tarjan(int x, int f, int l) {
  int low;
  lev[x] = low = l;
  s.push(x);
  int iscut = 0, son = 0;
  for (auto i : mp[x])
    if (i != f) {
      if (lev[i] != -1) {
        low = min(low, lev[i]);
        continue;
      }
      son++;
      int tmp = tarjan(i, x, l + 1);
      low = min(low, tmp);
      if (tmp >= l) {
        iscut = 1;
        bcnt++;
        int top;
        do {
          bcc[top = s.top()] = bcnt;
          vb[bcnt].push_back(top);
          s.pop();
        } while (top != i);
        bcc[x] = bcnt;
        vb[bcnt].push_back(x);
      }
    }
  if ((x != f && iscut) || (x == f && son > 1)) cutid[x] = ++ccnt;
  return low;
}
int inv[20], p[500135], bccCnt[500135], bccP[500135];
vector<int> lps;
void fmain(int tid) {
  scanf("%d%d", &n, &m);
  for (int(i) = 1; (i) <= (int)(m); (i)++) {
    scanf("%d%d", u + i, v + i);
    mp[u[i]].push_back(v[i]);
    mp[v[i]].push_back(u[i]);
  }
  memset(lev, -1, sizeof lev);
  tarjan(1, 0, 0);
  for (int(i) = 1; (i) <= (int)(19); (i)++) inv[i] = fastPow(i, 1000000007 - 2);
  for (int(i) = 1; (i) <= (int)(bcnt); (i)++)
    if (vb[i].size() > 2) {
      for (int x : vb[i]) bccCnt[x]++;
      lps.push_back(i);
    }
  int aa = (long long)n * (n + 1) % 1000000007 * inv[4] % 1000000007;
  int bb = 0;
  for (int(i) = 1; (i) <= (int)(m); (i)++) {
    int o = mp[u[i]].size() - 1 + mp[v[i]].size() - 1;
    addmod(bb, inv[4]);
    addmod(bb, (long long)o * inv[8] % 1000000007);
    addmod(bb, (long long)inv[16] * (m - o - 1) % 1000000007);
  }
  int cc = 0, Sum = 0;
  ;
  for (int id : lps) {
    p[id] = fastPow(fastPow(2, vb[id].size()), 1000000007 - 2);
    addmod(cc, p[id]);
    for (int x : vb[id]) addmod(bccP[x], p[id]);
    addmod(Sum, p[id]);
  }
  for (int id : lps) {
    int ss = 0;
    for (int x : vb[id]) addmod(ss, bccP[x] - p[id]);
    addmod(cc, (long long)p[id] * ss * 2 % 1000000007);
    addmod(cc, (long long)(Sum - p[id] - ss) * p[id] % 1000000007);
  }
  int ab = 0;
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    addmod(ab, (long long)mp[i].size() * inv[4] % 1000000007);
    addmod(ab, (long long)(m - mp[i].size()) * inv[8] % 1000000007);
  }
  int ac = 0;
  for (int id : lps) {
    addmod(ac, (long long)vb[id].size() * p[id] % 1000000007);
    addmod(ac, (long long)(n - vb[id].size()) * p[id] % 1000000007 * inv[2] %
                   1000000007);
  }
  int bc = 0;
  for (int id : lps) {
    addmod(bc, (long long)vb[id].size() * p[id] % 1000000007);
    int es = 0;
    for (int x : vb[id]) es += mp[x].size() - 2;
    addmod(bc, (long long)es * p[id] % 1000000007 * inv[2] % 1000000007);
    addmod(bc, (long long)(m - es - vb[id].size()) * p[id] % 1000000007 *
                   inv[4] % 1000000007);
  }
  int Ans = 0;
  addmod(Ans, aa);
  addmod(Ans, bb);
  addmod(Ans, cc);
  addmod(Ans, ac);
  addmod(Ans, ac);
  addmod(Ans, -ab);
  addmod(Ans, -ab);
  addmod(Ans, -bc);
  addmod(Ans, -bc);
  int A = (long long)n * inv[2] % 1000000007;
  int B = (long long)m * inv[4] % 1000000007;
  int C = Sum;
  int Ex = 0;
  addmod(Ex, A);
  addmod(Ex, -B);
  addmod(Ex, C);
  addmod(Ans, -(long long)Ex * Ex % 1000000007);
  printf("%d\n", Ans);
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
