#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using vvvll = vector<vector<vector<ll>>>;
using vvvvll = vector<vector<vector<vector<ll>>>>;
using pl4 = pair<ll, ll>;
using str = string;
using vpl4 = vector<pair<ll, ll>>;
ll MOD = 1000000007;
signed main() {
  ll(n);
  cin >> (n);
  ;
  ll(m);
  cin >> (m);
  ;
  vll(a)(m);
  for (ll i = 0; i <= m - 1; i++) {
    cin >> (a)[i];
  };
  vll c(n, 0);
  c[0] = 1;
  c[1] = 1;
  for (ll i = 2; i <= n - 1; i++) {
    c[i] = c[i - 1] + c[i - 2];
  }
  ll k = c[a[0] - 1];
  for (ll i = 1; i <= m - 1; i++) {
    if (a[i] - a[i - 1] == 1) {
      cout << (0) << endl;
      return 0;
    }
    k = (k * c[a[i] - a[i - 1] - 2]) % MOD;
  }
  k = (k * c[n - a[m - 1] - 1]) % MOD;
  cout << (k) << endl;
}
