#include <bits/stdc++.h>
int fib(int n) {
  if (n <= 2)
    return 1;
  else
    return fib(n - 1) + fib(n - 2);
}
int main(void) {
  int n, m, a[100001], i, j = 0, count = 0, ans = 1;
  scanf("%d %d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i <= n; i++) {
    if (a[j] + 1 == a[j + 1]) {
      ans = 0;
      break;
    } else if (i == a[j]) {
      ans *= fib(count);
      j++;
      count = 0;
    } else {
      count++;
    }
  }
  count--;
  ans *= fib(count);
  printf("%d\n", ans % 1000000007);
  return 0;
}
