#include <bits/stdc++.h>
template <class T>
inline void chmax(T& a, T b) {
  if (a < b) {
    a = b;
  }
}
template <class T>
inline void chmin(T& a, T b) {
  if (a > b) {
    a = b;
  }
}
const long long LLINF = 1LL << 62;
const int INF = 1LL << 30;
using namespace std;
int main(void) {
  long long N, M;
  cin >> N >> M;
  vector<long long> fib(N + 1);
  fib[1] = 1;
  for (int i = 2; i <= N; i++) {
    fib[i] = fib[i - 1] % 1000000007 + fib[i - 2] % 1000000007;
    fib[i] %= 1000000007;
  }
  vector<long long> broken_stair(M + 2);
  for (int i = 1; i <= M; i++) {
    cin >> broken_stair[i];
  }
  vector<long long> broken_stair_interbal(M + 2);
  for (int i = 1; i <= M; i++) {
    if (i == 1) {
      broken_stair_interbal[i] = broken_stair[i] - broken_stair[i - 1];
    } else {
      broken_stair_interbal[i] = broken_stair[i] - broken_stair[i - 1] - 1;
    }
    if (broken_stair_interbal[i] == 0) {
      cout << 0 << endl;
      return 0;
    }
  }
  broken_stair_interbal[M + 1] = N - broken_stair[M];
  long long ans = 1;
  for (int i = 1; i < broken_stair_interbal.size(); i++) {
    ans *= fib[broken_stair_interbal[i]] % 1000000007;
    ans %= 1000000007;
  }
  cout << ans % 1000000007 << endl;
  return 0;
}
