#include <bits/stdc++.h>
long double ff[100000] = {1, 1};
int p = 1;
long double f(int a) {
  if (a <= p) return ff[a];
  int i;
  for (i = p + 1; i <= a; i++) {
    ff[i] = ff[i - 1] + ff[i - 2];
  }
  p = a;
  return ff[a];
}
int main() {
  int n, m, a1, a2, i;
  long double sum;
  fscanf(stdin, "%d%d\n", &n, &m);
  if (m > 0) {
    fscanf(stdin, "%d", &a1);
    sum = f(a1 - 1);
    for (i = 1; i < m; i++) {
      fscanf(stdin, "%d", &a2);
      if (a1 + 1 == a2) {
        printf("0");
        return 0;
      }
      sum *= fmodl(f(a2 - a1 - 2), 1000000007);
      a1 = a2;
    }
    sum *= fmodl(f(n - a1 - 1), 1000000007);
  } else
    sum = f(n);
  printf("%.0Lf", fmodl(sum, 1000000007));
  return 0;
}
