#include <bits/stdc++.h>
int main(void) {
  int N, M, broken[100000], b = 0;
  long stairs[100000];
  scanf("%d %d", &N, &M);
  for (int i = 0; i < M; i++) scanf("%d", broken + i);
  if (0 != (broken[b] - 1)) {
    stairs[0] = 1;
  } else {
    stairs[0] = 0;
    b++;
  }
  if (1 != (broken[b] - 1)) {
    stairs[1] = 1 + stairs[0];
  } else {
    stairs[1] = 0;
    b++;
  }
  for (int i = 2; i < N; i++) {
    if (i != broken[b] - 1) {
      stairs[i] = stairs[i - 1] + stairs[i - 2];
    } else {
      stairs[i] = 0;
      b++;
    }
  }
  printf("%d\n", stairs[N - 1] % 1000000007);
  return 0;
}
