#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
const int N = 1e6 + 7;
const int INF = 1e9 + 7;
const long long BIG_INF = 1e18;
const int T = (1 << 19);
template <class T>
inline T gcd(T a, T b) {
  while (b) swap(a %= b, b);
  return abs(a);
}
struct plecak_zawsze_biore {
  vector<int> ile;
  plecak_zawsze_biore() {
    ile = vector<int>(4010);
    ile[0] = 1;
  }
  void add(int val) {
    for (int i = (int)ile.size() - 1; i >= val; i--)
      ile[i] = (ile[i] + ile[i - val]) % INF;
  }
  int val(int poz) { return ile[poz]; }
};
struct plecak_zawsze_biore2 {
  vector<int> ile;
  int shift = 4010;
  plecak_zawsze_biore2() {
    ile = vector<int>(8040);
    ile[shift] = 1;
  }
  void add(int val) {
    vector<int> nowy_ile(8040);
    for (int i = 0; i < (int)ile.size() - val; i++)
      nowy_ile[i] = (nowy_ile[i] + ile[i + val]) % INF;
    for (int i = val; i < (int)ile.size(); i++)
      nowy_ile[i] = (nowy_ile[i] + ile[i - val]) % INF;
    ile = nowy_ile;
  }
  int val(int poz) { return ile[poz + shift]; }
};
struct plecak_moge_nie_wziac {
  vector<int> ile;
  int shift = 4010;
  plecak_moge_nie_wziac() {
    ile = vector<int>(8040);
    ile[shift] = 1;
  }
  void add(int val) {
    vector<int> nowy_ile = ile;
    for (int i = 0; i < (int)ile.size() - val; i++)
      nowy_ile[i] = (nowy_ile[i] + ile[i + val]) % INF;
    for (int i = val; i < (int)ile.size(); i++)
      nowy_ile[i] = (nowy_ile[i] + ile[i - val]) % INF;
    ile = nowy_ile;
  }
  int val(int poz) { return ile[poz + shift]; }
};
vector<int> cykle;
int odw[N];
vector<vector<int> > G(N);
int dfs(int start) {
  int ret = 1;
  odw[start] = 1;
  for (auto& u : G[start])
    if (!odw[u]) ret += dfs(u);
  return ret;
}
void solve() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  odw[1] = 1;
  for (auto& u : G[1])
    if (!odw[u]) cykle.push_back(dfs(u) + 1);
  plecak_zawsze_biore p1;
  for (auto& u : cykle) p1.add(u);
  long long ret = 0;
  plecak_moge_nie_wziac pref;
  vector<plecak_moge_nie_wziac> dp_pref;
  plecak_zawsze_biore2 pref2;
  vector<plecak_zawsze_biore2> dp_pref2;
  dp_pref.push_back(pref);
  dp_pref2.push_back(pref2);
  for (int i = 0; i < (int)cykle.size(); i++) {
    pref.add(cykle[i]);
    dp_pref.push_back(pref);
    pref2.add(cykle[i]);
    dp_pref2.push_back(pref2);
  }
  plecak_moge_nie_wziac suf;
  plecak_zawsze_biore2 suf2;
  for (int i = (int)cykle.size() - 1; i >= 0; i--) {
    for (int a = 1; a < cykle[i]; a++) {
      int b = cykle[i] - a;
      int diff = a - b;
      for (int ile_z_suf = -2000; ile_z_suf <= 2000; ile_z_suf++) {
        int ile_z_pref = -diff - ile_z_suf;
        if (ile_z_pref >= -2000 and ile_z_pref <= 2000)
          ret = (ret + 1ll * dp_pref[i].val(ile_z_pref) * suf.val(ile_z_suf)) %
                INF;
      }
    }
    for (int a = 1; a < cykle[i] - 1; a++) {
      int b = cykle[i] - a - 1;
      int diff = a - b;
      for (int ile_z_suf = -2000; ile_z_suf <= 2000; ile_z_suf++) {
        int ile_z_pref = -diff - ile_z_suf;
        if (ile_z_pref >= -2000 and ile_z_pref <= 2000)
          ret = (ret + 1ll * dp_pref[i].val(ile_z_pref) * suf.val(ile_z_suf)) %
                INF;
      }
    }
    int a = 0;
    int b = cykle[i] - 1;
    int diff = a - b;
    for (int ile_z_suf = -2000; ile_z_suf <= 2000; ile_z_suf++) {
      int ile_z_pref = -diff - ile_z_suf;
      if (ile_z_pref >= -2000 and ile_z_pref <= 2000)
        ret = (ret + 1ll * dp_pref2[i].val(ile_z_pref) * suf2.val(ile_z_suf)) %
              INF;
    }
    a = cykle[i] - 1;
    b = 0;
    diff = a - b;
    for (int ile_z_suf = -2000; ile_z_suf <= 2000; ile_z_suf++) {
      int ile_z_pref = -diff - ile_z_suf;
      if (ile_z_pref >= -2000 and ile_z_pref <= 2000)
        ret = (ret + 1ll * dp_pref2[i].val(ile_z_pref) * suf2.val(ile_z_suf)) %
              INF;
    }
    suf.add(cykle[i]);
    suf2.add(cykle[i]);
  }
  cout << (ret * 2 + (m % 2 == 0) * p1.val(m / 2)) % INF << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}
