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