#include <bits/stdc++.h>
int main() {
  size_t n, m;
  std::cin >> n >> m;
  std::vector<std::pair<size_t, bool>> cnt(n, {0, true});
  for (size_t i = 0; i < m; i++) {
    size_t tmp;
    std::cin >> tmp;
    cnt[tmp - 1].second = false;
  }
  cnt[0].first = 1;
  cnt[1].first = 2;
  for (size_t i = 2; i < n; i++) {
    cnt[i].first = cnt[i - 1].first + cnt[i - 2].first;
    if (cnt[i].second == false) cnt[i].first = 0;
  }
  std::cout << cnt.at(n - 1).first % 1000000007 << std::endl;
  return 0;
}
