#include <bits/stdc++.h>
using namespace std;
const long long N = 1000000007;
int *Flag(int *A, int n) {
  int *B;
  B = (int *)malloc(sizeof(int) * (n + 1));
  int i, j;
  i = 0;
  j = 0;
  for (i = 0; i <= n; i++) {
    if (A[j] == i) {
      B[i] = 0;
      j++;
    } else {
      B[i] = 1;
    }
  }
  return B;
}
void count_way(int *B, int n) {
  if (n == 1) {
    cout << 1 << endl;
  }
  long long *C;
  C = (long long *)malloc(sizeof(long long) * (n + 1));
  C[0] = 1;
  C[1] = B[1];
  for (int i = 2; i <= n; i++) {
    C[i] = B[i] * (C[i - 2] + C[i - 1]) % N;
  }
  cout << C[n] << endl;
}
int main() {
  long long n, m;
  int *A;
  cin >> n >> m;
  A = (int *)malloc(sizeof(int) * m);
  for (int i = 0; i < m; i++) {
    cin >> A[i];
  }
  int *B;
  B = Flag(A, n);
  count_way(B, n);
  return 0;
}
