#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t mod = pow(10, 9) + 7;
  int n, m;
  cin >> n >> m;
  vector<int> oks(n + 1);
  for (int i = 0; i < (int)m; i++) {
    int a;
    cin >> a;
    oks.at(a) = 1;
  }
  vector<int64_t> dp(n + 1);
  dp.at(0) = 1;
  dp.at(1) = 1;
  if (oks.at(1) == 1) {
    dp.at(1) = 0;
  }
  for (int i = 2; i <= (int)(n); i++) {
    if (not(oks.at(i))) dp.at(i) = (dp.at(i - 1) + dp.at(i - 2));
  }
  cout << dp.at(n) % mod << endl;
}
