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