#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
const ll mod = 1e9 + 7;
const ll inf = 1e15;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
  ll n, m;
  cin >> n >> m;
  vll a(m);
  for (int i = 0; i < m; i++) cin >> a[i];
  vll dp(n + 1);
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 1; i <= n - 1; i++) {
    dp[i + 1] = dp[i - 1] + dp[i];
  }
  ll ans = 1;
  for (int i = 0; i < m; i++) {
    if (i != 0) {
      if (a[i] == a[i - 1] + 1) {
        cout << 0 << endl;
        return 0;
      }
    }
    if (i == 0)
      ans *= dp[a[i] - 1];
    else
      ans *= dp[a[i] - a[i - 1] - 2];
    ans %= mod;
  }
  ans *= dp[n - a[m - 1] - 1];
  cout << ans % mod << endl;
  return 0;
}
