#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long N, M, i, j, A;
  cin >> N >> M;
  unsigned long long answer[N];
  bool condition[N];
  memset(condition, true, N);
  for (i = 0; i < M; i++) {
    cin >> A;
    answer[A] = 0;
    condition[A] = false;
  }
  answer[0] = 0;
  if (condition[1]) {
    answer[1] = 1;
  } else {
    answer[1] = 0;
  }
  for (i = 2; i < M; i++) {
    if (!condition[i]) {
      continue;
    } else {
      answer[i] = answer[i - 1] + answer[i - 2];
    }
  }
  cout << answer[M - 1] % 1000000007 << endl;
  return 0;
}
