#include <bits/stdc++.h>
using namespace std;
const int N = 4004, md = 1e9 + 7;
int n, m, head[N], cnt;
struct edge {
  int to, nxt, id;
} e[N * 2];
bool vis[N];
int c[N], ans, k, S[N];
inline void upd(int& a) { a += a >> 31 & md; }
void dfs(int u, int sz) {
  if (u == 1 && sz) {
    S[++k] = sz;
    return;
  }
  for (int i = head[u]; i; i = e[i].nxt)
    if (!vis[e[i].id]) {
      vis[e[i].id] = 1;
      dfs(e[i].to, sz + 1);
    }
}
int dp[N / 2][N * 2][2];
void work(int len) {
  for (int i = 1; i <= k; ++i) memset(dp[i], 0, sizeof *dp);
  dp[0][4001][0] = 1;
  for (int i = 1; i <= k; ++i)
    if (S[i] != len || S[i] == S[i - 1]) {
      for (int s = -2 * n; s <= 2 * n; ++s) {
        if (s + S[i] <= 2 * n) {
          upd(dp[i][s + S[i] + 4001][0] += dp[i - 1][s + 4001][0] - md);
          upd(dp[i][s + S[i] + 4001][1] += dp[i - 1][s + 4001][1] - md);
        }
        if (s - S[i] >= -2 * n) {
          upd(dp[i][s - S[i] + 4001][0] += dp[i - 1][s + 4001][0] - md);
          upd(dp[i][s - S[i] + 4001][1] += dp[i - 1][s + 4001][1] - md);
        }
        upd(dp[i][s + 4001][1] += dp[i - 1][s + 4001][0] - md);
        upd(dp[i][s + 4001][1] += dp[i - 1][s + 4001][1] - md);
      }
    } else
      memcpy(dp[i], dp[i - 1], sizeof *dp);
  if (len == 0) {
    upd(ans += dp[k][4001][0] - md);
    return;
  }
  for (int i = 1; i < len; ++i) {
    ans = (ans + 2LL *
                     (dp[k][i - (len - i) + 4001][0] +
                      dp[k][i - (len - i) + 4001][1]) *
                     c[len]) %
          md;
  }
  for (int i = 1; i < len - 1; ++i) {
    ans = (ans + 2LL *
                     (dp[k][i - (len - i - 1) + 4001][0] +
                      dp[k][i - (len - i - 1) + 4001][1]) *
                     c[len]) %
          md;
  }
  ans = (ans + 2LL * dp[k][1 - len + 4001][0] * c[len]) % md;
  ans = (ans + 2LL * dp[k][len - 1 + 4001][0] * c[len]) % md;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    int u, v;
    cin >> u >> v;
    e[++cnt] = (edge){v, head[u], i}, head[u] = cnt;
    e[++cnt] = (edge){u, head[v], i}, head[v] = cnt;
  }
  dfs(1, 0);
  sort(S + 1, S + k + 1);
  for (int i = 1; i <= k; ++i) ++c[S[i]];
  for (int L = 1; L <= n; ++L)
    if (c[L]) work(L);
  work(0);
  cout << ans << '\n';
  return 0;
}
