#include <bits/stdc++.h>
const int INF = 1e9 + 7;
int main() {
  int n, m;
  std::cin >> n >> m;
  std::vector<int> broken(m);
  for (int i = 0; i < m; ++i) {
    std::cin >> broken.at(i);
  }
  std::vector<long long> steps(n + 1, 0);
  steps.at(0) = 1;
  if (1 != broken.at(0)) {
    steps.at(1) = 1;
  }
  for (int i = 2; i <= n; ++i) {
    if (!std::count(broken.begin(), broken.end(), i)) {
      steps.at(i) = (steps.at(i - 1) + steps.at(i - 2)) % INF;
    }
  }
  std::cout << steps.at(n);
  return 0;
}
