#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  int64_t mod = pow(10, 9) + 7;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a.at(i);
  }
  vector<int64_t> ans(N + 1, 0);
  ans.at(0) = 1;
  vector<bool> flag(N + 1, true);
  for (int i = 0; i < M; i++) {
    flag.at(a.at(i)) = false;
  }
  if (a.at(0) != 1) {
    ans.at(1) = 1;
  }
  for (int i = 2; i <= N; i++) {
    if (!flag.at(i)) {
      continue;
    }
    ans.at(i) = ans.at(i - 1) + ans.at(i - 2);
    ans.at(i) %= mod;
  }
  cout << ans.at(N) << endl;
  return 0;
}
