#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<ll> dp(100000, -1);
ll fab(ll n) {
  if (n == ll(-1)) return 0;
  if (dp[n] >= 0)
    return dp[n];
  else {
    dp[n] = fab(n - 1) + fab(n - 2);
    return dp[n];
  }
}
int main(int argc, const char *argv[]) {
  dp[0] = 1;
  dp[1] = 1;
  dp[2] = 2;
  ll n, m;
  cin >> n >> m;
  vector<ll> a(m);
  for (int i = 0; i < m; i++) cin >> a[i];
  ll ans = 1;
  ans *= fab(a[0] - ll(1));
  ans = ans % ll(1000000007);
  for (int i = 1; i < m; i++) {
    ans *= fab(a[i] - a[i - 1] - ll(2));
    ans = ans % ll(1000000007);
  }
  ans *= fab(n - a[m - 1] - ll(1));
  ans = ans % ll(1000000007);
  cout << ans << endl;
  return 0;
}
