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