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