#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
map<ll, ll> memo;
ll fib(ll a) {
  if (memo.count(a) > 0) return memo[a];
  memo[a] = fib(a - 1) + fib(a - 2);
  return memo[a];
}
int main() {
  memo[0] = 0;
  memo[1] = 1;
  ll MOD = 1000000007;
  ll N, M;
  cin >> N >> M;
  vector<ll> A(M);
  for (ll i = 0; i < ((ll)(M)); i++) {
    cin >> A.at(i);
  }
  ll res = 1;
  ll cur = 0;
  for (ll a : A) {
    res *= fib(a - cur);
    res %= MOD;
    cur = a + 1;
  }
  res *= fib(N - cur + 1);
  cout << res % MOD << endl;
}
