#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  for (int i = 0; i < (int)(M); ++i) {
    cin >> A.at(i);
    A.at(i)--;
  }
  if (N == 1) {
    cout << 1 << endl;
  } else {
    vector<long> dp(N + 10);
    dp.at(0) = 1;
    dp.at(1) = 2;
    if (0 == A.at(0)) {
      if (M > 1 && A.at(1) == 1) {
        dp.at(0) = 0;
        dp.at(1) = 0;
      } else {
        dp.at(0) = 0;
        dp.at(1) = dp.at(0) + 1;
      }
    } else if (A.at(0) == 1) {
      dp.at(0) = 0;
      dp.at(1) = 1;
    }
    int INF = 1000000007;
    for (int i = 0; i < (int)(M); ++i) {
      if (A.at(i) >= 1) {
        dp.at(A.at(i)) = INF;
      }
    }
    for (int i = (2); i < (int)(N); i++) {
      if (dp.at(i) != INF) {
        dp.at(i) = (dp.at(i - 1) + dp.at(i - 2)) % 1000000007;
      } else {
        dp.at(i) = 0;
      }
    }
    cout << dp.at(N - 1) << endl;
  }
}
