#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 500000;
const int MAX_M = 500000;
const int MD = 1000000007;
int n;
int m;
int p[MAX_N + 9];
int a[MAX_M * 2 + 9];
int b[MAX_M * 2 + 9];
vector<int> adj[MAX_N + 9];
bool used[MAX_N + 9];
bool del[MAX_M * 2 + 9];
vector<int> vNode;
vector<vector<int>> circle;
int totalP;
int sumP[MAX_N + 9];
int ans;
int Add(int x, int y) { return (x + y) % MD; }
int Sub(int x, int y) { return (x - y + MD) % MD; }
int Mul(int x, int y) { return (long long)x * y % MD; }
int Pwr(int x, int n) {
  int res = 1 % MD;
  for (int i = 0; (n >> i) > 0; i++) {
    if ((n >> i & 1) == 1) {
      res = Mul(res, x);
    }
    x = Mul(x, x);
  }
  return res;
}
int Div(int x, int y) { return Mul(x, Pwr(y, MD - 2)); }
void Dfs(int x) {
  used[x] = true;
  vNode.push_back(x);
  for (int id : adj[x]) {
    if (!del[id]) {
      del[(id - 1) % m + 1] = true;
      del[(id - 1) % m + m + 1] = true;
      int y = b[id];
      if (!used[y]) {
        Dfs(y);
      } else {
        circle.push_back(vector<int>());
        for (int i = vNode.size() - 1; i >= 0; i--) {
          circle.back().push_back(vNode[i]);
          if (vNode[i] == y) {
            break;
          }
        }
      }
    }
  }
  vNode.pop_back();
}
int ExpV() { return Mul(p[1], n); }
int ExpE() { return Mul(p[2], m); }
int ExpC() {
  int res = 0;
  for (vector<int>& c : circle) {
    res = Add(res, p[c.size()]);
  }
  return res;
}
int ExpVV() { return Mul(Add(p[1], Mul(p[2], n - 1)), n); }
int ExpEE() {
  int res = 0;
  for (int i = 1; i <= m; i++) {
    res = Add(res, p[2]);
    res = Add(res, Mul(p[3], adj[a[i]].size() - 1));
    res = Add(res, Mul(p[3], adj[b[i]].size() - 1));
    res = Add(res, Mul(p[4], m - adj[a[i]].size() - adj[b[i]].size() + 1));
  }
  return res;
}
int ExpCC() {
  int res = 0;
  for (vector<int>& c : circle) {
    res = Add(res, p[c.size()]);
    int leftP = Sub(totalP, p[c.size()]);
    for (int x : c) {
      res = Add(res, Mul(p[c.size() - 1], Sub(sumP[x], p[c.size()])));
      leftP = Sub(leftP, Sub(sumP[x], p[c.size()]));
    }
    res = Add(res, Mul(p[c.size()], leftP));
  }
  return res;
}
int ExpEV() {
  int res = 0;
  for (int i = 1; i <= m; i++) {
    res = Add(res, Mul(p[2], 2));
    res = Add(res, Mul(p[3], n - 2));
  }
  return res;
}
int ExpCV() {
  int res = 0;
  for (vector<int>& c : circle) {
    res = Add(res, Mul(p[c.size()], c.size()));
    res = Add(res, Mul(p[c.size() + 1], n - c.size()));
  }
  return res;
}
int ExpCE() {
  int res = 0;
  for (vector<int>& c : circle) {
    res = Add(res, Mul(p[c.size()], c.size()));
    int leftE = m - c.size();
    for (int x : c) {
      res = Add(res, Mul(p[c.size() + 1], adj[x].size() - 2));
      leftE -= adj[x].size() - 2;
    }
    res = Add(res, Mul(p[c.size() + 2], leftE));
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a[i] >> b[i];
    a[i + m] = b[i];
    b[i + m] = a[i];
    adj[a[i]].push_back(i);
    adj[b[i]].push_back(i + m);
  }
  p[n] = Div(1, Pwr(2, n));
  for (int i = n - 1; i >= 0; i--) {
    p[i] = Mul(p[i + 1], 2);
  }
  for (int i = 1; i <= n; i++) {
    if (!used[i]) {
      Dfs(i);
    }
  }
  totalP = 0;
  for (vector<int>& c : circle) {
    totalP = Add(totalP, p[c.size()]);
  }
  for (vector<int>& c : circle) {
    for (int x : c) {
      sumP[x] = Add(sumP[x], p[c.size()]);
    }
  }
  ans = ExpVV();
  ans = Add(ans, ExpEE());
  ans = Add(ans, ExpCC());
  ans = Sub(ans, Mul(ExpEV(), 2));
  ans = Sub(ans, Mul(ExpCE(), 2));
  ans = Add(ans, Mul(ExpCV(), 2));
  ans = Sub(ans, Pwr(Add(Sub(ExpV(), ExpE()), ExpC()), 2));
  cout << ans << "\n";
  return 0;
}
