#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int j = 0; j < m; j++) {
    cin >> a.at(j);
  }
  vector<int> f(n);
  f[0] = 1;
  f[1] = 1;
  for (int i = 2; i < n; i++) {
    auto itr = find(a.begin(), a.end(), i);
    if (itr != a.end()) {
      f[i] = 0;
    } else {
      f[i] = f[i - 1] + f[i - 2];
    }
  }
  cout << (f.at(n - 1) % 1000000007) << endl;
}
