#include <bits/stdc++.h>
int main(void) {
  int N, M, i, j, t;
  long long int s = 1;
  scanf("%d %d", &N, &M);
  int a[M + 1];
  int p[N + 1];
  p[0] = 0;
  p[1] = 1;
  if (N > 2) p[2] = 1;
  for (i = 3; i <= N; i++) p[i] = p[i - 2] + p[i - 1];
  for (j = 1; j <= M; j++) {
    scanf("%d", &a[j]);
    if (j > 1) {
      s = s * p[a[j] - a[j - 1] - 1] % 1000000007;
    } else {
      if (a[1] != 1) {
        s = s * p[a[j]] % 1000000007;
      } else {
        s = 1;
      }
    }
  }
  s = s * p[N - a[M]] % 1000000007;
  printf("%lld", s);
  return 0;
}
