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