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