#include <bits/stdc++.h>
using namespace std;
int main() {
  long long MOD = 1000000007;
  long long N, M;
  cin >> N >> M;
  vector<long long> A(M);
  for (long long i = 0; i < M; i++) {
    cin >> A[i];
  }
  for (long long i = 0; i < M - 1; i++) {
    if ((A[i] + 1) == A[i + 1]) {
      cout << 0;
      return 1;
    }
  }
  vector<long long> Cost(N + 10);
  Cost[0] = 1;
  Cost[1] = 1;
  Cost[2] = 2;
  for (long long i = 3; i < N + 10; i++) {
    Cost[i] = (Cost[i - 1] + Cost[i - 2]) % MOD;
  }
  long long m = 0;
  vector<long long> Step;
  vector<long long> CCC;
  for (long long i = 0; i < M; i++) {
    long long idx = A[i] - m - 1;
    long long cost = Cost[idx];
    CCC.push_back(cost);
    m = A[i] + 1;
  }
  long long cost = Cost[N - m];
  CCC.push_back(cost);
  long long total = 1;
  for (auto c : CCC) {
    total *= (c % MOD);
    total %= MOD;
  }
  cout << (total % MOD);
  return 0;
}
