#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e3 + 7;
const int MOD = 1e9 + 7;
const int D = 4e3 + 7;
int n, m, A[MAXN], cnt, L, R;
vector<int> G[MAXN];
void add(int &x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
bool vis[MAXN];
int dfs(int u) {
  vis[u] = true;
  for (int v : G[u])
    if (!vis[v]) return dfs(v) + 1;
  return 1;
}
int f[MAXN][D << 1], g[MAXN][D << 1];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  vis[1] = true;
  for (int u : G[1])
    if (!vis[u]) A[++cnt] = dfs(u) + 1;
  L = D - m, R = D + m;
  f[0][D] = g[cnt + 1][D] = 1;
  for (int i = 1; i <= cnt; i++)
    for (int j = L; j <= R; j++) {
      f[i][j] = f[i - 1][j];
      if (j + A[i] <= R) add(f[i][j], f[i - 1][j + A[i]]);
      if (j - A[i] >= L) add(f[i][j], f[i - 1][j - A[i]]);
    }
  for (int i = cnt; ~i; i--)
    for (int j = L; j <= R; j++) {
      g[i][j] = g[i + 1][j];
      if (j + A[i] <= R) add(g[i][j], g[i + 1][j + A[i]]);
      if (j - A[i] >= L) add(g[i][j], g[i + 1][j - A[i]]);
    }
  int ret = 0;
  for (int i = 1; i <= cnt; i++) {
    for (int j = -(A[i] - 2); j <= A[i] - 2; j++) {
      for (int k = L; k <= R; k++) {
        int d = j - (k - D) + D;
        if (L <= d and d <= R) add(ret, 1ll * f[i - 1][k] * g[i + 1][d] % MOD);
      }
    }
  }
  memset(f, 0, sizeof(f));
  memset(g, 0, sizeof(g));
  f[0][D] = g[cnt + 1][D] = 1;
  for (int i = 1; i <= cnt; i++)
    for (int j = L; j <= R; j++) {
      if (j + A[i] <= R) add(f[i][j], f[i - 1][j + A[i]]);
      if (j - A[i] >= L) add(f[i][j], f[i - 1][j - A[i]]);
    }
  for (int i = cnt; ~i; i--)
    for (int j = L; j <= R; j++) {
      if (j + A[i] <= R) add(g[i][j], g[i + 1][j + A[i]]);
      if (j - A[i] >= L) add(g[i][j], g[i + 1][j - A[i]]);
    }
  for (int i = 1; i <= cnt; i++) {
    int j = A[i] - 1;
    for (int k = L; k <= R; k++) {
      int d = j - (k - D) + D;
      if (L <= d and d <= R) add(ret, 1ll * f[i - 1][k] * g[i + 1][d] % MOD);
    }
    j = -j;
    for (int k = L; k <= R; k++) {
      int d = j - (k - D) + D;
      if (L <= d and d <= R) add(ret, 1ll * f[i - 1][k] * g[i + 1][d] % MOD);
    }
  }
  add(ret, ret);
  add(ret, f[cnt][D]);
  cout << ret << endl;
  return 0;
}
