#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 10;
const int mod = 1e9 + 7;
int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = (x << 1) + (x << 3) + c - '0', c = getchar();
  return x * f;
}
int dp1[N][2 * N][2];
int dp2[N][2 * N][2];
int vis[N];
vector<int> g[N];
int siz[N];
int inc(int x, int y) { return (x + y >= mod) ? (x + y - mod) : (x + y); }
int del(int x, int y) { return (x - y < 0) ? (x - y + mod) : (x - y); }
int dfs(int u) {
  vis[u] = 1;
  for (int v : g[u]) {
    if (vis[v]) continue;
    return dfs(v) + 1;
  }
  return 1;
}
int main() {
  int n = read(), m = read();
  for (int i = 1; i <= m; i++) {
    int u = read(), v = read();
    g[u].push_back(v);
    g[v].push_back(u);
  }
  int cnt = 0;
  vis[1] = 1;
  for (int i : g[1])
    if (!vis[i]) siz[++cnt] = (dfs(i) + 1);
  int O = 2e3;
  dp2[0][O][0] = dp1[0][O][0] = 1;
  for (int i = 1; i <= cnt; i++)
    for (int j = 0; j <= 2 * O; j++) {
      for (int t = 0; t <= 1; t++) {
        if (j - siz[i] >= 0)
          dp1[i][j][t] = inc(dp1[i][j][t], dp1[i - 1][j - siz[i]][t]);
        if (j + siz[i] <= 2 * O)
          dp1[i][j][t] = inc(dp1[i][j][t], dp1[i - 1][j + siz[i]][t]);
        dp1[i][j][t] = inc(dp1[i][j][t], dp1[i - 1][j][t]);
      }
      for (int t = 0; t <= 1; t++) {
        if (j - siz[i] >= 0)
          dp2[i][j][t] = inc(dp2[i][j][t], dp2[i - 1][j - siz[i]][t]);
        if (j + siz[i] <= 2 * O)
          dp2[i][j][t] = inc(dp2[i][j][t], dp2[i - 1][j + siz[i]][t]);
      }
      for (int y = 1; y < siz[i]; y++) {
        int x = siz[i] - y;
        if (j + x - y >= 0 && j + x - y <= 2 * O)
          dp1[i][j + x - y][1] = inc(dp1[i][j + x - y][1], dp1[i - 1][j][0]);
        if (j + y - x >= 0 && j + y - x <= 2 * O)
          dp1[i][j + y - x][1] = inc(dp1[i][j + y - x][1], dp1[i - 1][j][0]);
      }
      for (int y = 1; y < siz[i] - 1; y++) {
        int x = siz[i] - y - 1;
        if (j + x - y >= 0 && j + x - y <= 2 * O)
          dp1[i][j + x - y][1] = inc(dp1[i][j + x - y][1], dp1[i - 1][j][0]);
        if (j + y - x >= 0 && j + y - x <= 2 * O)
          dp1[i][j + y - x][1] = inc(dp1[i][j + y - x][1], dp1[i - 1][j][0]);
      }
      if (j - (siz[i] - 1) >= 0)
        dp2[i][j][1] =
            inc(dp2[i][j][1], 2ll * dp2[i - 1][j - (siz[i] - 1)][0] % mod);
      if (j + (siz[i] - 1) <= 2 * O)
        dp2[i][j][1] =
            inc(dp2[i][j][1], 2 * dp2[i - 1][j + (siz[i] - 1)][0] % mod);
    }
  int ans = 0;
  ans = inc(ans, dp1[cnt][O][1]);
  ans = inc(ans, dp2[cnt][O][1]);
  ans = inc(ans, dp2[cnt][O][0]);
  cout << ans << endl;
}
