#include <bits/stdc++.h>
#pragma warning(disable : 4996)
template <typename T>
T min(T x, T y) {
  return x < y ? x : y;
}
template <typename T>
T max(T x, T y) {
  return x > y ? x : y;
};
const long long INF = 2000000005;
const long long mod = 1000000007;
const long long MAXN = 4005;
int N, M, num;
std::vector<int> E[MAXN];
long long size[MAXN];
long long f[MAXN] = {1}, ans;
long long D[MAXN];
void update(int l, int r) {
  for (int i = l; i <= r; i++) {
    memset(D, 0, sizeof(D));
    for (int j = 0; j <= M; j++) {
      D[j + size[i]] += f[j], D[j + size[i]] %= mod;
      D[abs(j - size[i])] += f[j], D[abs(j - size[i])] %= mod;
    }
    for (int j = 0; j <= M; j++) f[j] += D[j], f[j] %= mod;
  }
}
void solve(int l, int r) {
  if (l == r) {
    for (int i = 0; i < size[l] - 1; i++) ans += f[i] * 2 % mod, ans %= mod;
    return;
  }
  long long *tmp = new long long[MAXN];
  memcpy(tmp, f, sizeof(f));
  int mid = (l + r) / 2;
  update(mid + 1, r);
  solve(l, mid);
  memcpy(f, tmp, sizeof(f));
  update(l, mid);
  solve(mid + 1, r);
  memcpy(f, tmp, sizeof(f));
  delete (tmp);
}
namespace DP2 {
void update(int l, int r) {
  for (int i = l; i <= r; i++) {
    for (int j = M; j >= 0; j--)
      if (j >= size[i]) f[j] += f[j - size[i]], f[j] %= mod;
  }
}
void solve(int l, int r) {
  if (l == r) {
    ans = (ans + f[M / 2] * 4) % mod;
    return;
  }
  long long *tmp = new long long[MAXN];
  memcpy(tmp, f, sizeof(f));
  int mid = (l + r) / 2;
  update(mid + 1, r);
  solve(l, mid);
  memcpy(f, tmp, sizeof(f));
  update(l, mid);
  solve(mid + 1, r);
  memcpy(f, tmp, sizeof(f));
  delete (tmp);
}
}  // namespace DP2
void init() {
  int u, v;
  static bool mark[MAXN];
  scanf("%d %d", &N, &M);
  for (int i = 1; i <= M; i++) {
    scanf("%d %d", &u, &v);
    E[u].push_back(v);
    E[v].push_back(u);
  }
  mark[1] = true;
  for (int i = 0; i < E[1].size(); i++) {
    if (mark[E[1][i]]) continue;
    v = E[1][i];
    size[++num] = 1;
    while (!mark[v]) {
      mark[v] = true;
      size[num]++;
      v = mark[E[v][0]] ? E[v][1] : E[v][0];
    }
  }
}
int main() {
  init();
  solve(1, num);
  if (M & 1) {
    DP2::solve(1, num);
  } else {
    for (int i = 1; i <= num; i++)
      for (int j = M; j >= 0; j--)
        if (j >= size[i]) f[j] = (f[j] + f[j - size[i]]) % mod;
    ans = (ans + f[M / 2]) % mod;
  }
  printf("%lld\n", ans);
  return 0;
}
