#include <bits/stdc++.h>
int N;
int M;
static char A[100000];
static int64_t memo[100000];
int64_t search(int i) {
  if (memo[i] != 0) return memo[i];
  if (A[i] == 1) return 0;
  if (i > N) return 0;
  if (i == N) return 1;
  int64_t ret0 = search(i + 1);
  int64_t ret1 = search(i + 2);
  int64_t ret = (ret0 + ret1) % 1000000007;
  memo[i] = ret;
  return ret;
}
int main(void) {
  scanf("%d%d", &N, &M);
  for (int i = 0; i < M; i++) {
    int a;
    scanf("%d", &a);
    A[a] = 1;
  }
  int X = search(0);
  printf("%d\n", X);
  return 0;
}
