#include <bits/stdc++.h>
using namespace std;
const int Mod = 1000000007;
const int inv2 = (Mod + 1) / 2;
struct Edge {
  int v, nxt;
} e[1000010];
int tot;
int first[500010];
int deg[500010];
void build(int u, int v) {
  e[++tot] = (Edge){v, first[u]};
  first[u] = tot;
  deg[u]++;
  return;
}
int N;
vector<int> vec[500010];
vector<int> s[500010];
int sta[500010], head;
bool insta[500010];
bool vis[500010];
void dfs(int u, int lst) {
  sta[++head] = u;
  insta[u] = true;
  vis[u] = true;
  for (int i = first[u]; i; i = e[i].nxt) {
    int v = e[i].v;
    if (v == lst) continue;
    if (!vis[v])
      dfs(v, u);
    else if (insta[v]) {
      N++;
      for (int j = head; sta[j] != v; j--) {
        vec[N].push_back(sta[j]);
        s[sta[j]].push_back(N);
      }
      vec[N].push_back(v);
      s[v].push_back(N);
    }
  }
  insta[u] = false;
  head--;
}
int u[500010], v[500010];
int pw[500010];
int sum[500010];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  pw[0] = 1;
  for (int i = 1; i <= max(n, 4); i++) pw[i] = 1ll * pw[i - 1] * inv2 % Mod;
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &u[i], &v[i]);
    build(u[i], v[i]);
    build(v[i], u[i]);
  }
  dfs(1, 0);
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < s[i].size(); j++)
      sum[i] = (sum[i] + pw[vec[s[i][j]].size()]) % Mod;
  int Sum = 0;
  for (int i = 1; i <= N; i++) Sum = (Sum + pw[vec[i].size()]) % Mod;
  int En, Em, Ec = 0;
  En = 1ll * n * inv2 % Mod;
  Em = 1ll * m * pw[2] % Mod;
  for (int i = 1; i <= N; i++) Ec = (Ec + pw[vec[i].size()]) % Mod;
  int Ex = ((En - Em + Ec) % Mod + Mod) % Mod;
  int En2 = (1ll * n * inv2 + 1ll * n * (n - 1) % Mod * pw[2]) % Mod;
  int Em2 = 0;
  for (int i = 1; i <= m; i++) {
    int num = deg[u[i]] + deg[v[i]] - 2;
    Em2 = (Em2 + pw[2]) % Mod;
    Em2 = (Em2 + 1ll * num * pw[3]) % Mod;
    Em2 = (Em2 + 1ll * (m - num - 1) * pw[4]) % Mod;
  }
  int Ec2 = 0;
  for (int i = 1; i <= N; i++) {
    int val = pw[vec[i].size()];
    Ec2 = (Ec2 + val) % Mod;
    int s = 0;
    for (int j = 0; j < vec[i].size(); j++) {
      int u = vec[i][j];
      s = (s + sum[u] - val) % Mod;
      if (s < 0) s += Mod;
    }
    Ec2 = (Ec2 + 2ll * s * val) % Mod;
    s = (s + val) % Mod;
    Ec2 = (Ec2 + 1ll * val * (Sum - s + Mod)) % Mod;
  }
  int Enc = 0;
  for (int i = 1; i <= N; i++) {
    int cnt = vec[i].size();
    Enc = (Enc + 1ll * pw[cnt] * cnt + 1ll * pw[cnt + 1] * (n - cnt)) % Mod;
  }
  Enc = 2ll * Enc % Mod;
  int Emc = 0;
  for (int i = 1; i <= N; i++) {
    int cnt1 = vec[i].size();
    int cnt2 = 0;
    for (int j = 0; j < vec[i].size(); j++) {
      int u = vec[i][j];
      cnt2 += deg[u] - 2;
    }
    Emc = (Emc + 1ll * cnt1 * pw[cnt1] + 1ll * cnt2 * pw[cnt1 + 1] +
           1ll * (m - cnt1 - cnt2) * pw[cnt1 + 2]) %
          Mod;
  }
  Emc = 2ll * Emc % Mod;
  int Enm = (inv2 + 1ll * (n - 2) * pw[3]) % Mod * m % Mod;
  Enm = 2ll * Enm % Mod;
  int Ex2 = En2;
  Ex2 = (Ex2 + Em2) % Mod;
  Ex2 = (Ex2 + Ec2) % Mod;
  Ex2 = (Ex2 + Enc) % Mod;
  Ex2 = (Ex2 - Emc + Mod) % Mod;
  Ex2 = (Ex2 - Enm + Mod) % Mod;
  int ans = (Ex2 - 1ll * Ex * Ex % Mod + Mod) % Mod;
  printf("%d\n", ans);
  return 0;
}
