#include <bits/stdc++.h>
int main(int argc, const char *argv[]) {
  int n, m;
  scanf("%d%d", &n, &m);
  long long a[100001];
  for (int i = 0; i <= n; i++) {
    a[i] = -1;
  }
  int tmp, ltmp = 0;
  for (int i = 0; i < m; i++) {
    scanf("%d", &tmp);
    if (tmp == ltmp - 1 || tmp == n) {
      printf("0\n");
      return 0;
    }
    a[tmp] = 0;
    ltmp = tmp;
  }
  a[0] = 1;
  if (a[1] == -1) a[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (a[i] != -1) continue;
    a[i] = a[i - 1] + a[i - 2];
  }
  printf("%llu\n", a[n] % 1000000007);
  return 0;
}
