#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, inf = 100000000000000;
  cin >> n >> m;
  vector<long long> a(m), f(n + 1, inf);
  for (int i = 0; i < m; i++) {
    cin >> a.at(i);
    f.at(a.at(i)) = 0;
  }
  f.at(0) = 1;
  if (f.at(1) != 0) f.at(1) = 1;
  for (int i = 2; i <= n; i++) {
    if (f.at(i) == inf) {
      f.at(i) = f.at(i - 1) + f.at(i - 2);
    }
  }
  cout << f.at(n) % 1000000007LL;
}
