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