#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> x(N + 1);
  vector<int> a(M);
  for (int i = 0; i < M; i++) cin >> a[i];
  x[0] = 1;
  if (find(a.begin(), a.end(), 1) != a.end()) {
    x[1] = 0;
  } else {
    x[1] = 1;
  }
  for (int i = 2; i <= N; i++) {
    if (find(a.begin(), a.end(), i - 2) == a.end() &&
        find(a.begin(), a.end(), i - 1) == a.end()) {
      x[i] = x[i - 1] + x[i - 2];
    } else if (find(a.begin(), a.end(), i - 2) != a.end() &&
               find(a.begin(), a.end(), i - 1) == a.end()) {
      x[i] = x[i - 1];
    } else if (find(a.begin(), a.end(), i - 2) == a.end() &&
               find(a.begin(), a.end(), i - 1) != a.end()) {
      x[i] = x[i - 2];
    } else {
      x[N] = 0;
      break;
    }
  }
  cout << x[N] % 1000000007 << endl;
  return 0;
}
