#include <bits/stdc++.h>
using namespace std;
const long long INF = (1ll << 60);
const long long MOD = (long long)1e9 + 7;
signed main() {
  long long n, m;
  long long a[100000];
  cin >> n >> m;
  for (long long i = 0; i < m; i++) cin >> a[i];
  set<long long> s;
  for (long long i = 0; i < m; i++) s.insert(a[i]);
  long long dp[100001] = {1, 1};
  for (long long i = 2; i <= n; i++) dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
  long long pr = INF;
  bool f = true;
  vector<long long> v{0, n};
  for (auto itr = s.begin(); itr != s.end(); itr++) {
    v.push_back(*itr);
    if (*itr - pr == 1) f = false;
    pr = *itr;
  }
  sort(v.begin(), v.end());
  long long ret = 1;
  if (!f) {
    cout << 0 << endl;
    return 0;
  } else {
    for (long long i = 1; i < v.size(); i++) {
      ret = (ret * dp[v[i] - v[i - 1] - 1]) % MOD;
    }
  }
  cout << ret << endl;
}
