#include <bits/stdc++.h>
int main() {
  int n, m, a;
  std::cin >> n >> m;
  std::vector<bool> brake(n, 0);
  std::vector<int> t(n, 0);
  for (int i = 0; i < m; i++) {
    std::cin >> a;
    brake[a - 1] = 1;
  }
  t[0] = 1;
  if (brake[1] == 1)
    t[1] = 0;
  else
    t[1] = 1;
  for (int i = 2; i < n; i++) {
    if (brake[i] == 0) t[i] = (t[i - 1] + t[i - 2]) % 1000000007;
  }
  std::cout << t[n - 1] << std::endl;
  return 0;
}
