#include <bits/stdc++.h>
int fib(int n) {
  if (n == 0) return 1;
  if (n == 1) return 1;
  return fib(n - 1) + fib(n - 2);
}
int main() {
  int n, m;
  int sol = 1;
  scanf("%d", &n);
  scanf("%d", &m);
  int am, prevam = 0;
  int i = 0;
  while (i++ < m) {
    scanf("%d", &am);
    if (prevam != 0 && prevam + 1 == am) {
      printf("0\n");
      return 0;
    }
    sol = sol * fib(am - prevam - 1) % 1000000007;
    prevam = am;
  }
  sol = sol * fib(n - prevam - 1) % 1000000007;
  printf("%d\n", sol);
  return 0;
}
