#include <bits/stdc++.h>
int main() {
  long long n, m, d[100000], a, b = 0, c, p = 1;
  scanf("%lld %lld", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%lld", &a);
    if (a == b) {
      printf("0\n");
      exit(0);
    }
    d[0] = 1;
    d[1] = 1;
    a = a - 1;
    c = a - b;
    if (c > 1) {
      for (int i = 2; i <= c; i++) {
        d[i] = d[i - 1] + d[i - 2];
      }
    }
    b = a + 2;
    p *= d[c];
    p %= 1000000007;
  }
  c = n - b;
  if (c > 1) {
    for (int i = 2; i <= c; i++) {
      d[i] = d[i - 1] + d[i - 2];
    }
  }
  p *= d[c];
  p %= 1000000007;
  printf("%lld\n", p);
  return 0;
}
