#include <bits/stdc++.h>
using namespace std;
const int inv2 = (1000000007 + 1) / 2;
inline int read() {
  int x = 0;
  char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x;
}
vector<int> v[500010];
inline int add(int x, int y) {
  return x + y >= 1000000007 ? x + y - 1000000007 : x + y;
}
inline int dec(int x, int y) { return x - y < 0 ? x - y + 1000000007 : x - y; }
inline int mul(int x, int y) { return 1LL * x * y % 1000000007; }
int vis[500010], idx[500010], stk[500010], top;
vector<vector<int> > Cir;
void dfs(int x, int lst) {
  vis[x] = 1, stk[idx[x] = ++top] = x;
  for (auto y : v[x]) {
    if (vis[y] == 2 || y == lst) continue;
    if (vis[y]) {
      vector<int> tmp;
      tmp.clear();
      for (int i = idx[y]; i <= top; i++) tmp.push_back(stk[i]);
      Cir.push_back(tmp);
    } else
      dfs(y, x);
  }
  vis[x] = 2, stk[top--] = 0;
}
int Pow[500010], inv[500010];
inline void init(int n) {
  Pow[0] = inv[0] = 1;
  for (int i = 1; i <= n; i++)
    Pow[i] = 1LL * Pow[i - 1] * 2 % 1000000007,
    inv[i] = 1LL * inv[i - 1] * inv2 % 1000000007;
}
int sum[500010], sum2[500010], d[500010];
inline int calc2(int n, int m) {
  int res = dec(mul(n, inv[1]), mul(m, inv[2]));
  for (auto cir : Cir) res = add(res, inv[cir.size()]);
  return mul(res, res);
}
inline int V(int n, int m) {
  return add(mul(n, inv[1]), mul(mul(n, n - 1), inv[2]));
}
inline int E(int n, int m) {
  int ans = add(mul(m, m), m);
  for (int i = 1; i <= n; i++) ans = add(ans, mul(d[i], d[i]));
  return mul(ans, inv[4]);
}
inline int C(int n, int m) {
  int ans = 0;
  for (auto c : Cir) ans = add(ans, inv[c.size()]);
  ans = add(ans, mul(ans, ans));
  for (auto c : Cir) ans = dec(ans, mul(inv[c.size()], inv[c.size()]));
  for (int i = 1; i <= n; i++)
    ans = add(ans, dec(mul(sum[i], sum[i]), sum2[i]));
  return ans;
}
inline int VC(int n, int m) {
  int ans = 0;
  for (auto c : Cir) ans = add(ans, mul(n + c.size(), inv[c.size() + 1]));
  return ans;
}
inline int VE(int n, int m) { return mul(n + 2, mul(m, inv[3])); }
inline int EC(int n, int m) {
  int ans = 0;
  for (auto c : Cir) {
    int D = 0;
    for (auto x : c) D = add(D, d[x]);
    D = dec(D, c.size() * 2);
    ans = add(
        ans,
        mul(inv[c.size()],
            add(c.size(), add(mul(inv[1], D), mul(inv[2], m - c.size() - D)))));
  }
  return ans;
}
inline int calc1(int n, int m) {
  int tmp1 = add(V(n, m), add(E(n, m), C(n, m)));
  int tmp2 = dec(VC(n, m), add(VE(n, m), EC(n, m)));
  return add(tmp1, mul(tmp2, 2));
}
int main() {
  int n = read(), m = read();
  for (int i = 1; i <= m; i++) {
    int x = read(), y = read();
    v[x].push_back(y), v[y].push_back(x), d[x]++, d[y]++;
  }
  dfs(1, 0);
  init(500010 - 1);
  for (auto c : Cir)
    for (auto x : c)
      sum[x] = add(sum[x], inv[c.size()]),
      sum2[x] = add(sum2[x], mul(inv[c.size()], inv[c.size()]));
  cout << (calc1(n, m) - calc2(n, m) + 1000000007) % 1000000007 << endl;
  return 0;
}
