#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  for (int i = 0; i < M; i++) cin >> A.at(i);
  vector<long> step(N);
  step.at(0) = 1;
  step.at(1) = 1;
  for (int i = 2; i < N; i++) {
    step.at(i) = step.at(i - 1) + step.at(i - 2);
    step.at(i) %= 1000000007;
  }
  long long ans = 1;
  int now = 0;
  for (int i = 0; i < M + 1; i++) {
    long long tmp_ans = 0;
    int num_step;
    if (i < M)
      num_step = A.at(i) - 1 - now;
    else
      num_step = N - now;
    if (num_step < 0)
      tmp_ans = 0;
    else
      tmp_ans = step.at(num_step);
    ans *= tmp_ans;
    ans %= 1000000007;
    if (!ans) break;
    if (i < M) now = A.at(i) + 1;
  }
  cout << ans << endl;
}
