#include <bits/stdc++.h>
using namespace std;
using namespace std;
vector<long long> buf;
void permutation(long long i, const long long size, const long long range_start,
                 const long long range_end) {
  if (i == size) {
    for (long long itr : buf) {
      cout << itr;
    }
  } else {
    for (long long j = range_start; j <= range_end; ++j) {
      buf[i] = j;
      permutation(i + 1, size, range_start, range_end);
    }
  }
}
int main(void) {
  long long n, m, a;
  long long mod = pow(10, 9) + 7;
  cin >> n >> m;
  vector<long long> A(n + 1);
  A[0] = 1;
  for (long long i = 0; i < (n); i++) {
    cin >> a;
    A[a] = -1;
  }
  for (long long i = 1; i <= n; i++) {
    if (A[i] == -1) {
      continue;
    }
    if (i == 1) {
      A[i] = A[i - 1];
      continue;
    }
    if (A[i - 1] == -1 && A[i - 2] == -1) {
      break;
    } else if (A[i - 1] == -1) {
      A[i] = A[i - 2];
    } else if (A[i - 2] == -1) {
      A[i] = A[i - 1];
    } else {
      A[i] = (A[i - 1] + A[i - 2]) % mod;
    }
  }
  cout << A[n] << endl;
  return 0;
}
