#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
long long mod = 1e9 + 7;
vector<long long> g[3000];
long long vis[3000];
vector<long long> v;
void dfs(long long s, long long l) {
  vis[s] = 1;
  for (long long i = 0; i < g[s].size(); i++) {
    if (vis[g[s][i]] == 0) {
      dfs(g[s][i], l + 1);
    } else {
      if (g[s][i] == 1) {
        v.push_back(l + 1);
      }
    }
  }
}
map<long long, long long> ansc;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, i, j;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    long long u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
    long long p = min(u, v);
  }
  dfs(1, 0);
  long long p = v.size();
  sort((v).begin(), (v).end(), greater<long long>());
  p /= 2;
  for (i = 0; i < p; i++) {
    v.pop_back();
  }
  long long ans = 0;
  for (i = 0; i < v.size(); i++) {
    if (ansc.find(v[i]) != ansc.end()) {
      ans += ansc[v[i]];
      ans %= mod;
      continue;
    }
    long long p = m;
    vector<long long> dp(2 * p + 4, 0);
    vector<long long> dp2(2 * p + 4, 0);
    dp[p + 1] = 1;
    dp2[p + 1] = 1;
    for (j = 0; j < v.size(); j++) {
      if (j == i) continue;
      vector<long long> ep(2 * p + 4);
      vector<long long> ep2(2 * p + 4);
      for (long long k = -p; k <= p; k++) {
        ep[k + p + 1] = dp[k + p + 1];
        if (k - v[j] >= -p) {
          ep[k + p + 1] += dp[k - v[j] + p + 1];
          ep[k + p + 1] %= mod;
          ep2[k + p + 1] += dp2[k - v[j] + p + 1];
          ep2[k + p + 1] %= mod;
        }
        if (k + v[j] <= p) {
          ep[k + p + 1] += dp[k + v[j] + p + 1];
          ep[k + 1 + p] %= mod;
          ep2[k + p + 1] += dp2[k + v[j] + p + 1];
          ep2[k + 1 + p] %= mod;
        }
      }
      dp = ep;
      dp2 = ep2;
    }
    p = v[i];
    long long tns = 0;
    for (j = 1; j < p; j++) {
      tns += dp[p - 2 * j + m + 1];
      tns %= mod;
      if (j < p - 1) tns += dp[p - 2 * j + m];
      tns %= mod;
    }
    tns += dp2[p + m];
    tns += dp2[p - (2 * (p - 1)) + m];
    tns %= mod;
    ansc[v[i]] = tns;
    ans += tns;
    ans %= mod;
  }
  vector<long long> dp(m + 2, 0);
  dp[0] = 1;
  for (i = 0; i < v.size(); i++) {
    vector<long long> ep(m + 2, 0);
    for (j = 0; j <= m; j++) {
      ep[j] = dp[j];
      if (j - v[i] >= 0) {
        ep[j] += dp[j - v[i]];
        ep[j] %= mod;
      }
    }
    dp = ep;
  }
  ans *= 2;
  if (m % 2 == 0) {
    ans += dp[m / 2];
    ans %= mod;
  }
  ans %= mod;
  cout << ans;
  return 0;
}
