#include <bits/stdc++.h>
using namespace std;
int main() {
  long x = 1000000007;
  long n, m;
  cin >> n >> m;
  vector<bool> a(n + 1);
  for (long i = 0; i < m; i++) {
    int k;
    cin >> k;
    a.at(k) = true;
  }
  vector<long> p(n + 1, 0);
  p.at(0) = !a.at(0);
  if (n > 1) p.at(1) = !a.at(1);
  for (int i = 2; i < n + 1; i++) {
    if (a.at(i))
      p.at(i) = 0;
    else
      p.at(i) = (p.at(i - 1) + p.at(i - 2)) % x;
  }
  cout << p.at(n) % x << endl;
}
