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