#include <bits/stdc++.h>
int main(void) {
  int n, m;
  long y = 1000000007;
  scanf("%d%d", &n, &m);
  int d[m];
  for (int i = 0; i < m; i++) {
    scanf("%d", &d[i]);
  }
  long x[n], s = 0;
  x[0] = 1;
  x[1] = 2;
  if (d[0] == 1 || d[0] == 2) {
    s++;
    x[0] = 0;
    x[1] = 1;
  }
  for (int i = 2; i < n; i++) {
    x[i] = 0;
  }
  for (int i = 2; i < n; i++) {
    if (i + 1 == d[s]) {
      s++;
      continue;
    }
    x[i] = x[i - 2] + x[i - 1];
  }
  printf("%ld", x[n - 1] % y);
  return 0;
}
