#include <bits/stdc++.h>
long long fibo(long long n) {
  if (n < 0)
    return 0;
  else if (n == 0 || n == 1)
    return 1;
  else
    return fibo(n - 1) % 1000000007 + fibo(n - 2) % 1000000007;
}
int main(void) {
  long long n, m;
  long long a[1000000] = {0};
  long long ans = 1;
  scanf("%lld %lld", &n, &m);
  for (int i = 0; i < m; i++) scanf("%lld", &a[i]);
  for (int i = 0; i <= m; i++) {
    if (i == 0)
      ans = (ans * fibo(a[i] - 1)) % 1000000007;
    else if (i == m)
      ans = (ans * fibo(n - a[i - 1] - 1)) % 1000000007;
    else
      ans = (ans * fibo(a[i] - a[i - 1] - 2)) % 1000000007;
  }
  printf("%lld", ans);
  return 0;
}
