#include <bits/stdc++.h>
int main() {
  int N, M;
  long long mod = 1000000007;
  scanf("%d", &N);
  scanf("%d", &M);
  std::vector<int> a(M);
  std::vector<long long> fibonatti(100000 + 5);
  for (int i = 0; i < M; i++) {
    scanf("%d", &a[i]);
  }
  fibonatti[0] = 1;
  fibonatti[1] = 1;
  fibonatti[2] = 2;
  for (int i = 3; i <= N; i++) {
    fibonatti[i] = fibonatti[i - 1] + fibonatti[i - 2];
    fibonatti[i] %= mod;
  }
  long long ans = 1;
  ans *= fibonatti[a[0] - 1];
  ans %= mod;
  for (int i = 1; i < M; i++) {
    if (a[i] - a[i - 1] == 1) {
      printf("0\n");
      return 0;
    }
    ans *= fibonatti[a[i] - a[i - 1] - 2];
    ans %= mod;
  }
  ans *= fibonatti[N - a[M - 1] - 1];
  ans %= mod;
  printf("%lld\n", ans);
  return 0;
}
