#include <bits/stdc++.h>
using namespace std;
bool Pairsecond(const pair<int, int>& pf, pair<int, int>& ps) {
  return pf.second < ps.second;
}
long long kaidan[100000];
int main() {
  int n, m;
  cin >> n >> m;
  int nw = 0;
  vector<int> b;
  for (int i = 0; m > i; i++) {
    int tm;
    cin >> tm;
    b.push_back(tm);
  }
  sort(b.begin(), b.end());
  if (b[0] == 0) {
    cout << 0 << endl;
    return 0;
  } else {
    kaidan[0] = 1;
  }
  if (b[0] == 1) {
    kaidan[1] = 0;
    nw++;
  } else {
    kaidan[1] = 1;
  }
  for (int i = 2; n >= i; i++) {
    if (b[nw] == i) {
      kaidan[i] = 0;
      nw++;
      continue;
    }
    kaidan[i] = (long long)(kaidan[i - 1] + kaidan[i - 2]) % 1000000007;
  }
  cout << kaidan[n] << endl;
}
