#include <bits/stdc++.h>
using ll = long long;
static const ll mod = 1e9 + 7;
static const ll INF = 1LL << 50;
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = (int)0; i < (int)m; ++i) {
    cin >> a[i];
    if (i)
      if (a[i] - 1 == a[i - 1]) {
        cout << "0" << endl;
        return 0;
      }
  }
  ll f[100000];
  f[0] = f[1] = 1;
  for (int i = 2; i <= n; ++i) f[i] = f[i - 1] + f[i - 2];
  a.push_back(-1);
  a.push_back(n + 1);
  sort(a.begin(), a.end());
  ll sum = 1;
  for (int i = 1; i < a.size(); ++i) {
    if (a[i] == 0) continue;
    sum *= (f[a[i] - a[i - 1] - 2] % mod);
    sum %= mod;
  }
  cout << sum << endl;
}
