#include <bits/stdc++.h>
int main(void) {
  int N, M;
  scanf("%d%d", &N, &M);
  short f[N + 1];
  unsigned long long int fibo[N + 1];
  for (int i = 0; i < N + 1; i++) f[i] = 1;
  for (int i = 0; i < M; i++) {
    int num;
    scanf("%d", &num);
    f[num] = 0;
  }
  fibo[0] = fibo[1] = 1;
  fibo[0] *= f[0], fibo[1] *= f[1];
  for (int i = 2; i < N + 1; i++) {
    fibo[i] = (fibo[i - 1] + fibo[i - 2]) * f[i];
  }
  printf("%llu\n", fibo[N]);
  return 0;
}
