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