#include <bits/stdc++.h>
int main() {
  long long waru = 1000000007;
  long long N, M;
  long long i;
  long long ans = 1;
  long long(*a) = (long long(*))malloc(100010 * sizeof(long long));
  long long(*s) = (long long(*))malloc(100010 * sizeof(long long));
  long long(*fib) = (long long(*))malloc(100010 * sizeof(long long));
  scanf("%lld%lld", &N, &M);
  for (i = 0; i < M; i++) scanf("%lld", &a[i]);
  a[M] = N + 1;
  s[0] = a[0] - 1;
  fib[0] = 1;
  fib[1] = 1;
  for (i = 1; i <= M; i++) {
    s[i] = a[i] - a[i - 1] - 1;
    if (s[i] <= 0) {
      printf("0\n");
      return 0;
    }
  }
  for (i = 2; i < N; i++) {
    fib[i] = fib[i - 1] + fib[i - 2];
  }
  ans *= fib[s[0]];
  for (i = 1; i <= M; i++) {
    ans *= fib[s[i] - 1];
  }
  printf("%lld\n", ans % waru);
  return 0;
}
