#include <bits/stdc++.h>
int kMod = 1e9 + 7;
void print_all(const std::vector<int>& v) {
  for (int x : v) {
    std::cout << x << '\n';
  }
}
int main() {
  int n, m;
  std::cin >> n >> m;
  std::vector<bool> is_broken(n, false);
  for (int i = 0; i < m; i++) {
    int broken_index;
    std::cin >> broken_index;
    is_broken.at(broken_index - 1) = true;
  }
  std::vector<int> patterns(n, 0);
  if (is_broken.at(0)) {
    patterns.at(0) = 0;
  } else {
    patterns.at(0) = 1;
  }
  if (is_broken.at(1)) {
    patterns.at(1) = 0;
  } else {
    patterns.at(1) = patterns.at(0) + 1;
  }
  for (int i = 2; i < n; i++) {
    if (is_broken.at(i)) {
      patterns.at(i) = 0;
    } else {
      patterns.at(i) = (patterns.at(i - 1) + patterns.at(i - 2)) % kMod;
    }
  }
  std::cout << patterns.back() << '\n';
  return 0;
}
