#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int N = 8040;
int f[N / 4][N], g[N / 4][N], h[N / 4][N], l[N], vis[N], cnt, cnt2, H[N / 4][N];
vector<int> s[N];
void add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
void dfs(int x) {
  int i, y;
  vis[x] = 1;
  cnt++;
  for (i = 0; i < s[x].size(); i++) {
    y = s[x][i];
    if (!vis[y]) dfs(y);
  }
}
int main() {
  int n, m, x, y, i, j, k, ans = 0;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    s[x].push_back(y);
    s[y].push_back(x);
  }
  vis[1] = 1;
  for (i = 0; i < s[1].size(); i++) {
    y = s[1][i];
    if (!vis[y]) cnt = 0, dfs(y), l[++cnt2] = cnt + 1;
  }
  f[0][m] = 1;
  for (i = 0; i < cnt2; i++) {
    for (j = -m; j <= m; j++) {
      if (f[i][j + m]) {
        add(f[i + 1][j + m], f[i][j + m]);
        add(f[i + 1][j + l[i + 1] + m], f[i][j + m]);
        add(f[i + 1][j - l[i + 1] + m], f[i][j + m]);
      }
    }
  }
  g[cnt2 + 1][m] = 1;
  for (i = cnt2 + 1; i > 1; i--) {
    for (j = -m; j <= m; j++) {
      if (g[i][j + m]) {
        add(g[i - 1][j + m], g[i][j + m]);
        add(g[i - 1][j + l[i - 1] + m], g[i][j + m]);
        add(g[i - 1][j - l[i - 1] + m], g[i][j + m]);
      }
    }
  }
  for (i = 1; i <= cnt2; i++) {
    for (j = -m; j <= m; j++) {
      if (f[i - 1][j + m])
        for (k = max(2 - l[i] - j, -m); k <= min(l[i] - 2 - j, m); k++) {
          if (g[i + 1][k + m]) {
            ans =
                (ans + (long long)f[i - 1][j + m] * g[i + 1][k + m] % mod * 2) %
                mod;
          }
        }
    }
  }
  h[0][m] = 1;
  for (i = 0; i < cnt2; i++) {
    for (j = -m; j <= m; j++) {
      if (h[i][j + m]) {
        add(h[i + 1][j + l[i + 1] + m], h[i][j + m]);
        add(h[i + 1][j - l[i + 1] + m], h[i][j + m]);
      }
    }
  }
  H[cnt2 + 1][m] = 1;
  for (i = cnt2 + 1; i > 1; i--) {
    for (j = -m; j <= m; j++) {
      if (H[i][j + m]) {
        add(H[i - 1][j + l[i - 1] + m], H[i][j + m]);
        add(H[i - 1][j - l[i - 1] + m], H[i][j + m]);
      }
    }
  }
  if (m % 2 == 0)
    ans = (ans + h[cnt2][0 + m]) % mod;
  else {
    for (i = 1; i <= cnt2; i++) {
      for (j = -m; j <= m; j++) {
        if (h[i - 1][j + m]) {
          k = 1 - l[i] - j;
          if (k >= -m)
            if (H[i + 1][k + m])
              ans = (ans +
                     (long long)h[i - 1][j + m] * H[i + 1][k + m] % mod * 2) %
                    mod;
          k = l[i] - 1 - j;
          if (k <= m)
            if (H[i + 1][k + m])
              ans = (ans +
                     (long long)h[i - 1][j + m] * H[i + 1][k + m] % mod * 2) %
                    mod;
        }
      }
    }
  }
  printf("%d\n", ans % mod);
  return 0;
}
