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