#include <bits/stdc++.h>
int main(void) {
  long n, m, i, ap = 0;
  scanf("%ld %ld", &n, &m);
  long *step = (long *)malloc(sizeof(long) * (n + 1));
  long *a = (long *)malloc(sizeof(long) * m);
  for (i = 0; i < m; i++) scanf("%ld", &a[i]);
  step[0] = 1;
  step[1] = 1;
  for (i = 0; i <= n; i++) {
    if (i == a[ap]) {
      step[i] = 0;
      if (ap != m - 1) ap += 1;
      continue;
    }
    if (i == 0 || i == 1) {
      step[i] = 1;
      continue;
    }
    step[i] = (step[i - 2] + step[i - 1]) % 1000000007;
  }
  printf("\n%ld\n", step[n]);
}
