#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000000 + 7;
const long long INF = -mod;
using ll = long long;
using P = pair<long long, long long>;
using vl = vector<long long>;
long long gcd(long long m, long long n) {
  long long a = max((ll)m, (ll)n);
  long long b = min((ll)m, (ll)n);
  long long r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
long long lcd(long long m, long long n) { return m * n / gcd(m, n); }
long long power(long long x, long long N) {
  long long ret = 1;
  for (long long i = 0; i < N; i++) ret *= x;
  return ret;
}
long long repeat_squaring(long long x, long long n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0) {
    long long t = repeat_squaring(x, n / 2);
    return t * t % mod;
  } else
    return x * repeat_squaring(x, n - 1);
}
long long Comb(long long n, long long r);
long long modC(long long n, long long r) {
  vector<long long> f(n + 1), inv(n + 1), invf(n + 1);
  f[0] = f[1] = 1;
  invf[0] = invf[1] = 1;
  inv[1] = 1;
  for (long long i = 2; i < n + 1; i++) {
    f[i] = (i * f[i - 1]) % mod;
    inv[i] = mod - ((mod / i) * inv[mod % i]) % mod;
    invf[i] = (inv[i] * invf[i - 1]) % mod;
  }
  long long cmb = f[n] * (invf[r] * invf[n - r] % mod) % mod;
  if (n >= r)
    return cmb;
  else
    return 0;
}
map<long long, long long> factor(long long p) {
  ll p1 = p;
  map<long long, long long> ret;
  for (long long i = 2; i * i <= p1; i++) {
    while (p % i == 0) {
      ret[i]++;
      p /= i;
    }
  }
  if (p != 1) ret[p]++;
  return ret;
}
bool is_prime(long long N) {
  for (long long i = 2; i * i <= N; i++) {
    if (N % i == 0) return false;
  }
  return true;
}
void chmax(long long &a, long long b) { a = max((ll)a, (ll)b); }
void chmin(long long &a, long long b) { a = min((ll)a, (ll)b); }
int main() {
  cout << fixed << setprecision(10);
  long long N;
  cin >> N;
  long long M;
  cin >> M;
  vector<long long> a(M);
  for (long long i = 0; i < M; i++) cin >> a.at(i);
  vl f(100000 + 10);
  f[0] = 0;
  f[1] = 1;
  f[2] = 2;
  for (int i = 3; i < 100000 + 5; i++) {
    f[i] = (f[i - 1] + f[i - 2]) % mod;
  }
  ll res = 1;
  for (int i = 0; i < M + 1; i++) {
    if (i == 0)
      res *= max((ll)(ll)1, (ll)f.at(a[0] - 1));
    else if (i == M)
      res *= max((ll)(ll)1, (ll)f.at(N - a[M - 1] - 1));
    else
      res *= f.at(a[i] - a[i - 1] - 1);
    res %= mod;
  }
  cout << res;
}
