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