#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, k, l;
int a[8011][2], ls[2001], len;
int b[2001], t, tot, ans, x, y;
int f[8011][2], F[8011][2];
bool Bz[8011];
void New(int x, int y) {
  ++len;
  a[len][0] = y;
  a[len][1] = ls[x];
  ls[x] = len;
}
void dfs(int t, int Len) {
  bool bz = 0;
  int i;
  if (t == 1 && Len) {
    b[++::t] = Len;
    return;
  }
  for (i = ls[t]; i; i = a[i][1])
    if (!Bz[i / 2]) Bz[i / 2] = 1, dfs(a[i][0], Len + 1), bz = 1;
}
void Add(int x, int y, int z, int s) {
  F[x][z] = ((F[x][z]) + (s)) % 1000000007,
  F[y + 1][z] = ((F[y + 1][z]) + (-s)) % 1000000007;
}
int main() {
  scanf("%d%d", &n, &m);
  len = 1;
  for (i = 1; i <= m; i++) scanf("%d%d", &j, &k), New(j, k), New(k, j);
  dfs(1, 0);
  memset(f, 0, sizeof(f)), f[m][0] = 1;
  for (i = 1; i <= t; i++) {
    memset(F, 0, sizeof(F));
    for (j = 0; j <= m + m; j++) {
      for (k = 0; k <= 1; k++)
        if (f[j][k]) {
          Add(j, j, k, f[j][k]);
          Add(j + b[i], j + b[i], k, f[j][k]);
          Add(j - b[i], j - b[i], k, f[j][k]);
          if (!k) {
            x = j + (1 - (b[i] - 1));
            y = j + ((b[i] - 1) - 1);
            if (x <= y) Add(x, y, 1, f[j][k] * 2 % 1000000007);
          }
        }
    }
    for (j = 0; j <= m + m - 1; j++)
      for (k = 0; k <= 1; k++)
        F[j + 1][k] = ((F[j + 1][k]) + (F[j][k])) % 1000000007;
    memcpy(f, F, sizeof(f));
  }
  ans = ((ans) + (f[m][1])) % 1000000007;
  memset(f, 0, sizeof(f)), f[m][0] = 1;
  for (i = 1; i <= t; i++) {
    memset(F, 0, sizeof(F));
    for (j = 0; j <= m + m; j++) {
      for (k = 0; k <= 1; k++)
        if (f[j][k]) {
          Add(j + b[i], j + b[i], k, f[j][k]);
          Add(j - b[i], j - b[i], k, f[j][k]);
          if (!k) {
            Add(j + (b[i] - 1), j + (b[i] - 1), 1, f[j][k] * 2 % 1000000007);
            Add(j - (b[i] - 1), j - (b[i] - 1), 1, f[j][k] * 2 % 1000000007);
          }
        }
    }
    for (j = 0; j <= m + m - 1; j++)
      for (k = 0; k <= 1; k++)
        F[j + 1][k] = ((F[j + 1][k]) + (F[j][k])) % 1000000007;
    memcpy(f, F, sizeof(f));
  }
  ans = ((ans) + ((f[m][0] + f[m][1]) % 1000000007)) % 1000000007;
  printf("%d\n", (ans + 1000000007) % 1000000007);
  fclose(stdin);
  fclose(stdout);
  return 0;
}
