#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> fragile(n + 1, true);
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    fragile[a] = false;
  }
  vector<long long int> fx(n + 1);
  fx.at(0) = 1;
  if (fragile[1]) {
    fx.at(1) = 1;
  } else {
    fx.at(1) = 0;
  }
  for (int now = 2; now < n + 1; now++) {
    if (fragile[now]) {
      fx.at(now) = fx.at(now - 1) + fx.at(now - 2);
    } else {
      fx.at(now) = 0;
    }
  }
  cout << fx.at(n) % mod << endl;
}
