#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n, m;
  cin >> n >> m;
  vector<long long> check(n + 1, 1);
  int a;
  for (int i = 0; i < m; i++) {
    cin >> a;
    check.at(a) = 0;
  }
  vector<long long> dp(n + 1, 0);
  dp.at(0) = 1;
  if (check.at(1)) {
    dp.at(1) = 1;
  } else
    dp.at(1) = 0;
  for (int i = 2; i <= n; i++) {
    if (check.at(i)) {
      dp.at(i) = dp.at(i - 1) + dp.at(i - 2);
    } else
      dp.at(i) = 0;
  }
  cout << dp.at(n) % 1000000007 << endl;
  return 0;
}
