#include <bits/stdc++.h>
int main(int argc, const char *argv[]) {
  int N, M;
  int i, j;
  int *aM;
  long long int *caseNum;
  scanf("%d", &N);
  scanf("%d", &M);
  aM = (int *)calloc(M, sizeof(int));
  caseNum = (long long int *)calloc(N, sizeof(long long int));
  for (i = 0; i < M; i++) {
    scanf("%d", &aM[i]);
  }
  caseNum[0] = 1;
  caseNum[1] = 2;
  for (j = 0; j < M; j++) {
    if (aM[j] == 1) {
      caseNum[0] = 0;
      caseNum[1] = 1;
    }
    if (aM[j] == 2) {
      caseNum[1] = 0;
      break;
    }
  }
  for (i = 2; i < N; i++) {
    caseNum[i] = (caseNum[i - 1] + caseNum[i - 2]) % 1000000007;
    for (j = 0; j < M; j++) {
      if (aM[j] == i + 1) {
        caseNum[i] = 0;
        break;
      }
      if (aM[j] > i + 1) {
        break;
      }
    }
  }
  printf("%lld\n", caseNum[N - 1]);
  free(aM);
  free(caseNum);
  return 0;
}
