#include <bits/stdc++.h>
using namespace std;
const int M = 4e3;
const int N = 2e3 + 5;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int bit = 32;
const double pi = acos(-1.0);
bool vis[N];
int a[N];
int dp[N][2 * M + 4][2], tp[N][2 * M + 4][2];
vector<int> v[N];
int dfs(int x) {
  vis[x] = true;
  for (int i = 0; i < v[x].size(); i++) {
    int y = v[x][i];
    if (vis[y]) continue;
    return dfs(y) + 1;
  }
  return 1;
}
void add(int &x, int y) {
  x += y;
  if (x < 0) {
    x += mod;
  } else if (x >= mod)
    x -= mod;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int len = 0;
  while (m--) {
    int x, y;
    scanf("%d%d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  vis[1] = true;
  for (int i = 0; i < v[1].size(); i++) {
    int y = v[1][i];
    if (!vis[y]) {
      a[++len] = dfs(y) + 1;
    }
  }
  dp[0][M][0] = tp[0][M][0] = 1;
  int sz = 0;
  for (int i = 1; i <= len; i++) {
    for (int j = -sz; j <= sz; j++) {
      add(dp[i][j + M + a[i]][0], dp[i - 1][j + M][0]);
      add(dp[i][j + M - a[i]][0], dp[i - 1][j + M][0]);
      add(dp[i][j + M][0], dp[i - 1][j + M][0]);
      add(dp[i][j + M + a[i]][1], dp[i - 1][j + M][1]);
      add(dp[i][j + M - a[i]][1], dp[i - 1][j + M][1]);
      add(dp[i][j + M][1], dp[i - 1][j + M][1]);
      add(tp[i][j + M + a[i]][0], tp[i - 1][j + M][0]);
      add(tp[i][j + M - a[i]][0], tp[i - 1][j + M][0]);
      add(tp[i][j + M + a[i]][1], tp[i - 1][j + M][1]);
      add(tp[i][j + M - a[i]][1], tp[i - 1][j + M][1]);
      for (int k = 1; k < a[i]; k++) {
        int p = a[i] - k;
        add(dp[i][j + k - p + M][1], 2ll * dp[i - 1][j + M][0] % mod);
      }
      for (int k = 1; k < a[i] - 1; k++) {
        int p = a[i] - 1 - k;
        add(dp[i][j + k - p + M][1], 2ll * dp[i - 1][j + M][0] % mod);
      }
      add(tp[i][j + a[i] - 1 + M][1], 2ll * tp[i - 1][j + M][0] % mod);
      add(tp[i][j - a[i] + 1 + M][1], 2ll * tp[i - 1][j + M][0] % mod);
    }
    sz += (a[i]);
  }
  printf("%d\n", (dp[len][M][1] + tp[len][M][1] + tp[len][M][0]) % mod);
  return 0;
}
