#include <bits/stdc++.h>
int main() {
  int A[10000];
  int N, M;
  for (int i = 0; i < 10000; i++) {
    A[i] = 0;
  }
  scanf("%d %d", &N, &M);
  for (int i = 0; i < M; i++) {
    int tmp;
    scanf("%d", &tmp);
    A[tmp] = -1;
  }
  A[0] = 1;
  A[1] = 1;
  int i = 2;
  while (i <= N) {
    if (A[i] == -1) {
      A[i] = 0;
      i++;
      if (A[i] == -1) {
        printf("0");
        return 0;
      }
      A[i] = A[i - 2];
      A[i] %= 1000000007;
      i++;
      continue;
    } else {
      A[i] += A[i - 2];
      A[i] += A[i - 1];
      A[i] %= 1000000007;
      i++;
    }
  }
  printf("%d", A[N]);
  return 0;
}
