#include <bits/stdc++.h>
using namespace std;
const long long DELTA = 2001;
const long long MOD = 1e9 + 7;
long long N, M, id;
vector<long long> ady[4005];
bool vis[4005];
long long tam[4005], sum[4005];
long long memo[4005][4005][2];
long long dp2(long long cyc, long long diff, bool split) {
  if (cyc > id) return (diff == 0);
  if (diff > 0 && diff - sum[cyc] > 0) return 0;
  if (diff < 0 && diff + sum[cyc] < 0) return 0;
  if (memo[cyc][diff + DELTA][split] != -1)
    return memo[cyc][diff + DELTA][split];
  long long ans = 0;
  ans = (ans + dp2(cyc + 1, diff + tam[cyc], split)) % MOD;
  ans = (ans + dp2(cyc + 1, diff - tam[cyc], split)) % MOD;
  if (!split) {
    ans = (ans + 2 * dp2(cyc + 1, diff + tam[cyc] - 1, 1)) % MOD;
    ans = (ans + 2 * dp2(cyc + 1, diff - tam[cyc] + 1, 1)) % MOD;
  }
  return memo[cyc][diff + DELTA][split] = ans;
}
long long dp(long long cyc, long long diff, bool split) {
  if (cyc > id) return (diff == 0 && split);
  if (diff > 0 && diff - sum[cyc] > 0) return 0;
  if (diff < 0 && diff + sum[cyc] < 0) return 0;
  if (memo[cyc][diff + DELTA][split] != -1)
    return memo[cyc][diff + DELTA][split];
  long long ans = 0;
  ans = (ans + dp(cyc + 1, diff + tam[cyc], split)) % MOD;
  ans = (ans + dp(cyc + 1, diff - tam[cyc], split)) % MOD;
  ans = (ans + dp(cyc + 1, diff, split)) % MOD;
  if (!split) {
    for (long long i = 1; i < tam[cyc]; i++) {
      long long otro = tam[cyc] - i;
      ans = (ans + 2 * dp(cyc + 1, diff + i - otro, 1)) % MOD;
    }
    for (long long i = 1; i < tam[cyc] - 1; i++) {
      long long otro = tam[cyc] - i - 1;
      ans = (ans + 2 * dp(cyc + 1, diff + i - otro, 1)) % MOD;
    }
  }
  return memo[cyc][diff + DELTA][split] = ans;
}
long long dfs(long long x, long long p) {
  vis[x] = 1;
  for (auto v : ady[x])
    if (v != p && !vis[v]) return dfs(v, x) + 1;
  return 1;
}
void getCycles() {
  vis[1] = 1;
  for (auto v : ady[1])
    if (!vis[v]) {
      tam[++id] = dfs(v, 1) + 1;
    }
  for (long long i = id; i >= 1; i--) sum[i] = sum[i + 1] + tam[i];
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> N >> M;
  for (long long i = 1; i <= M; i++) {
    long long u, v;
    cin >> u >> v;
    ady[u].push_back(v);
    ady[v].push_back(u);
  }
  getCycles();
  memset(memo, -1, sizeof memo);
  long long ans = (dp(1, 0, 0)) % MOD;
  memset(memo, -1, sizeof memo);
  ans = (ans + dp2(1, 0, 0)) % MOD;
  cout << ans << "\n";
  return 0;
}
