#include <bits/stdc++.h>
const int N = 8e3 + 20, Mod = 1e9 + 7;
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;
}
int tot = 1, fir[N], nex[N], got[N];
inline void AddEdge(int u, int v) {
  nex[++tot] = fir[u], fir[u] = tot, got[tot] = v;
}
int vis[N], a[N];
inline int dfs(int u) {
  vis[u] = true;
  for (int i = fir[u]; i; i = nex[i])
    if (!vis[got[i]]) return dfs(got[i]) + 1;
  return 0;
}
int f[2][N], g[N >> 1][N];
int main() {
  int n = read(), M = read(), m = 0;
  vis[1] = true;
  for (int i = 1; i <= M; i++) {
    int u = read(), v = read();
    AddEdge(u, v), AddEdge(v, u);
  }
  for (int i = fir[1]; i; i = nex[i])
    if (!vis[got[i]]) a[++m] = dfs(got[i]) + 2;
  f[0][(0 + 4005)] = g[m + 1][(0 + 4005)] = 1;
  int now = 0;
  for (int i = m; i >= 1; --i)
    for (int j = -M; j <= M; ++j) {
      g[i][(j + 4005)] = g[i + 1][(j + 4005)];
      if (j - a[i] >= -M)
        (g[i][(j + 4005)] += g[i + 1][(j - a[i] + 4005)]) %= Mod;
      if (j + a[i] <= M)
        (g[i][(j + 4005)] += g[i + 1][(j + a[i] + 4005)]) %= Mod;
    }
  int ans = 0;
  for (int i = 1; i <= m; ++i) {
    int w = a[i] - 2, res = 0;
    for (int j = -M; j <= M; ++j)
      (g[i + 1][(j + 4005)] += g[i + 1][(j - 1 + 4005)]) %= Mod;
    for (int j = -M; j <= M; ++j)
      if (f[now][(j + 4005)]) {
        int l = std::max(j - w, -M), r = std::min(j + w, M);
        (res += 2LL * (g[i + 1][(r + 4005)] - g[i + 1][(l - 1 + 4005)] + Mod) *
                f[now][(j + 4005)] % Mod) %= Mod;
      }
    (ans += res) %= Mod, now ^= 1;
    for (int j = -M; j <= M; ++j) {
      f[now][(j + 4005)] = f[now ^ 1][(j + 4005)];
      if (j - a[i] >= -M)
        (f[now][(j + 4005)] += f[now ^ 1][(j - a[i] + 4005)]) %= Mod;
      if (j + a[i] <= M)
        (f[now][(j + 4005)] += f[now ^ 1][(j + a[i] + 4005)]) %= Mod;
    }
  }
  memset(g, 0, sizeof(g)), g[0][(0 + 4005)] = 1;
  for (int i = 1; i <= m; ++i)
    for (int j = -M; j <= M; ++j) {
      if (j - a[i] >= -M)
        (g[i][(j + 4005)] += g[i - 1][(j - a[i] + 4005)]) %= Mod;
      if (j + a[i] <= M)
        (g[i][(j + 4005)] += g[i - 1][(j + a[i] + 4005)]) %= Mod;
    }
  (ans += g[m][(0 + 4005)]) %= Mod;
  memset(f, 0, sizeof(f)), f[0][(0 + 4005)] = 1, now = 0;
  for (int i = m; i >= 1; --i) {
    for (int j = -M; j <= M; ++j) {
      if (!f[now][(j + 4005)]) continue;
      int w1 = -(a[i] - 1) - j, w2 = (a[i] - 1) - j;
      if (w1 >= -M)
        (ans += 2LL * f[now][(j + 4005)] * g[i - 1][(w1 + 4005)] % Mod) %= Mod;
      if (w2 <= M)
        (ans += 2LL * f[now][(j + 4005)] * g[i - 1][(w2 + 4005)] % Mod) %= Mod;
    }
    now ^= 1;
    for (int j = -M; j <= M; ++j) {
      f[now][(j + 4005)] = 0;
      if (j - a[i] >= -M)
        (f[now][(j + 4005)] += f[now ^ 1][(j - a[i] + 4005)]) %= Mod;
      if (j + a[i] <= M)
        (f[now][(j + 4005)] += f[now ^ 1][(j + a[i] + 4005)]) %= Mod;
    }
  }
  std::cout << ans << std::endl;
  return 0;
}
