#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;
  scanf("%d", &n);
  scanf("%d", &m);
  int am, prevam = 0;
  while (scanf("%d", &am)) {
    if (prevam + 1 == am) {
      printf("0\n");
      return 0;
    } else {
      prevam = am;
    }
  }
  printf("%d", fib(n - m) % 1000000007);
}
