#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int M;
  cin >> M;
  vector<int> A(M);
  for (int i = 0; i < N; i++) cin >> A[i];
  vector<long> c(N);
  vector<int> b(N);
  for (int i = 0; i < M; i++) {
    b[A[i]] = 1;
  }
  c[0] = 1;
  if (A[0] == 1)
    c[1] = 0;
  else
    c[1] = 1;
  for (int i = 2; i < N + 1; i++) {
    if (b[i] == 1)
      c[i] = 0;
    else
      c[i] = (c[i - 1] + c[i - 2]) % 1000000007;
  }
  cout << c[N] << endl;
}
