#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
vector<int> g[2005];
bool vis[2005];
int dfs(int u) {
  vis[u] = 1;
  int ans = 1;
  for (int i = 0; i < (int)(g[u]).size(); i++) {
    int v = g[u][i];
    if (vis[v]) continue;
    ans += dfs(v);
  }
  return ans;
}
int cnt[2005];
int dp[2][4005][2];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    g[a].emplace_back(b);
    g[b].emplace_back(a);
  }
  vis[1] = 1;
  for (int i = 0; i < (int)(g[1]).size(); i++) {
    int v = g[1][i];
    if (vis[v]) continue;
    cnt[dfs(v)]++;
  }
  int pv = 0, cur = 1;
  dp[pv][n][0] = 1;
  for (int i = 1; i <= n; i++) {
    if (cnt[i] != 0) {
      int e = i + 1;
      for (int j = 1; j <= cnt[i]; j++) {
        memset(dp[cur], 0, sizeof(dp[cur]));
        for (int k = 0; k <= 2 * n; k++) {
          if (dp[pv][k][0] != 0) {
            if (k - e >= 0)
              dp[cur][k - e][0] = (dp[cur][k - e][0] + dp[pv][k][0]) % mod;
            if (k + e <= 2 * n)
              dp[cur][k + e][0] = (dp[cur][k + e][0] + dp[pv][k][0]) % mod;
            dp[cur][k][0] = (dp[cur][k][0] + dp[pv][k][0]) % mod;
          }
          if (dp[pv][k][1] != 0) {
            if (k - e >= 0)
              dp[cur][k - e][1] = (dp[cur][k - e][1] + dp[pv][k][1]) % mod;
            if (k + e <= 2 * n)
              dp[cur][k + e][1] = (dp[cur][k + e][1] + dp[pv][k][1]) % mod;
            dp[cur][k][1] = (dp[cur][k][1] + dp[pv][k][1]) % mod;
          }
        }
        for (int k = 0; k <= 2 * n; k++) {
          if (dp[pv][k][0] != 0) {
            for (int l = 1; l <= e - 1; l++) {
              int r = e - l;
              if (0 <= k - l + r && k - l + r <= 2 * n)
                dp[cur][k - l + r][1] =
                    (dp[cur][k - l + r][1] + dp[pv][k][0] * 1ll * 2) % mod;
              r = e - l - 1;
              if (r >= 1 && 0 <= k - l + r && k - l + r <= 2 * n)
                dp[cur][k - l + r][1] =
                    (dp[cur][k - l + r][1] + dp[pv][k][0] * 1ll * 2) % mod;
            }
          }
        }
        swap(pv, cur);
      }
    }
  }
  int ans = dp[pv][n][1];
  memset(dp, 0, sizeof(dp));
  dp[pv][n][0] = 1;
  for (int i = 1; i <= n; i++) {
    if (cnt[i] != 0) {
      int e = i + 1;
      for (int j = 1; j <= cnt[i]; j++) {
        memset(dp[cur], 0, sizeof(dp[cur]));
        for (int k = 0; k <= 2 * n; k++) {
          if (dp[pv][k][0] != 0) {
            if (k - e >= 0)
              dp[cur][k - e][0] = (dp[cur][k - e][0] + dp[pv][k][0]) % mod;
            if (k + e <= 2 * n)
              dp[cur][k + e][0] = (dp[cur][k + e][0] + dp[pv][k][0]) % mod;
          }
          if (dp[pv][k][1] != 0) {
            if (k - e >= 0)
              dp[cur][k - e][1] = (dp[cur][k - e][1] + dp[pv][k][1]) % mod;
            if (k + e <= 2 * n)
              dp[cur][k + e][1] = (dp[cur][k + e][1] + dp[pv][k][1]) % mod;
          }
        }
        for (int k = 0; k <= 2 * n; k++) {
          if (dp[pv][k][0] != 0) {
            int r = e - 1;
            if (k - r >= 0)
              dp[cur][k - r][1] =
                  (dp[cur][k - r][1] + dp[pv][k][0] * 1ll * 2) % mod;
            if (k + r <= 2 * n)
              dp[cur][k + r][1] =
                  (dp[cur][k + r][1] + dp[pv][k][0] * 1ll * 2) % mod;
          }
        }
        swap(pv, cur);
      }
    }
  }
  ans = (ans + dp[pv][n][0]) % mod;
  ans = (ans + dp[pv][n][1]) % mod;
  printf("%d\n", ans);
}
