#include <bits/stdc++.h>
using namespace std;
int main() {
  size_t n, m;
  cin >> n >> m;
  vector<size_t> holes(m);
  for (size_t i = m - 1; i < m; --i) cin >> holes[i];
  n += 1;
  vector<unsigned long long> steps(n);
  for (size_t i = 0; i < n; ++i) {
    if (holes[holes.size() - 1] == i) {
      holes.pop_back();
      steps[i] = 0;
      continue;
    }
    if (i < 2) {
      steps[i] = 1;
      continue;
    }
    steps[i] = (steps[i - 1] + steps[i - 2]) % (unsigned long long)1000000007;
  }
  cout << steps[steps.size() - 1] << endl;
  return 0;
}
