#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<bool> can(N + 1, true);
  for (int i = 0; i < M; i++) {
    int tmp;
    cin >> tmp;
    can.at(tmp) = false;
  }
  vector<long long> dp(N + 1, 0);
  dp.at(0) = 1;
  for (int now = 0; now < N; now++) {
    for (int next = now + 1; next <= min(N, now + 2); next++) {
      if (can.at(next)) {
        dp.at(next) += dp.at(now);
        dp.at(next) %= (long long)(1e9 + 7);
      }
    }
  }
  cout << dp.at(N - 1);
}
