#include <bits/stdc++.h>
int main(void) {
  long int n, m;
  scanf("%ld %ld", &n, &m);
  long int ary[n + 1];
  ary[0] = 1;
  ary[1] = 1;
  long int l;
  for (long int i = 0; i < m; i++) {
    scanf("%ld", &l);
    ary[l] = 0;
  }
  for (long int i = 2; i <= n; i++) {
    if (ary[i] != 0) ary[i] = (ary[i - 2] + ary[i - 1]) % (10 ^ 9 + 7);
  }
  printf("%ld\n", ary[n]);
  return 0;
}
