#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int mxn = 8001;
int n, m, k;
int a[mxn], first[mxn], par[mxn], rnk[mxn];
long long dp[mxn][2], dp2[mxn][2];
int fnd(int x) { return x == par[x] ? x : par[x] = fnd(par[x]); }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i < n; i++) a[par[i] = i] = 1;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    if (--u && --v) {
      u = fnd(u), v = fnd(v);
      if (rnk[u] < rnk[v]) swap(u, v);
      rnk[u] += rnk[u] == rnk[v];
      a[par[v] = u] += a[v];
    }
  }
  dp[2 * n][0] = dp[2 * n][1] = 1;
  for (int i = 1; i < n; i++)
    if (fnd(i) == i) {
      first[++a[i]]++;
      swap(dp, dp2);
      memset(dp, 0, sizeof(dp));
      for (int j = a[i]; j <= 4 * n - a[i]; j++) {
        (dp[j][0] += dp2[j][0]) %= mod;
        for (int l = 0; l < 2; l++) {
          (dp[j - a[i]][l] += dp2[j][l]) %= mod;
          (dp[j + a[i]][l] += dp2[j][l]) %= mod;
        }
      }
    }
  long long ret = dp[2 * n][1];
  for (int i = 1; i <= n; i++)
    if (first[i]) {
      long long x = 0;
      memset(dp2, 0, sizeof(dp2));
      for (int j = i; j <= 4 * n - i; j++) {
        for (int l = 0; l < 2; l++) {
          (dp2[j][l] += dp[j - i][l]) %= mod;
          if (j + 2 * i <= 4 * n) {
            (dp2[j + 2 * i][l] += mod - dp2[j][l]) %= mod;
          }
        }
        (dp2[j + i][0] += mod - dp2[j][0]) %= mod;
        if (abs(2 * n - j) < i) {
          (x += dp2[j][abs(2 * n - j) == i - 1]) %= mod;
        }
      }
      (ret += 2 * first[i] * x) %= mod;
    }
  cout << ret << '\n';
  return 0;
}
