#include <bits/stdc++.h>
long long powll(long long a, long long b) {
  long long r = 1;
  for (long long i = 0; i < (b); i++) {
    r *= a;
  }
  return r;
}
long long fib(long long steps) {
  if (steps < 0) return 0;
  long long x0 = 0, x1 = 1, ret = 1;
  for (long long _ = 0; _ < (steps); _++) {
    ret = x0 + x1;
    x0 = x1;
    x1 = ret;
  }
  return ret;
}
int main(void) {
  long long N, M, a[100100], ans = 1;
  scanf("%lld %lld", &N, &M);
  if (M == 0) {
    printf("%lld\n", fib(N));
    return 0;
  }
  for (long long i = 0; i < (M); i++) scanf("%lld", a + i);
  for (long long i = 0; i < (M + 1); i++) {
    if (i == 0 || i == M) {
      if (i == 0)
        ans *= fib(a[0] - 1);
      else
        ans *= fib(N - a[M - 1] - 1);
    } else
      ans *= fib(a[i] - a[i - 1] - 2);
    ans %= 1000000007;
  }
  printf("%lld\n", ans);
  return 0;
}
