#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
using V = vector<T>;
template <class T, class U>
using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const ll MOD = 1000000007;
const ll HIGHINF = (ll)1e18;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n, m;
  cin >> n >> m;
  unordered_set<ll> a;
  for (ll i = 0; i < (ll)m; ++i) {
    ll _a;
    cin >> _a;
    a.insert(_a);
  }
  vll d(n, 1);
  if (a.find(1) == a.end()) d[0] = 0;
  for (ll i = 2; i < (ll)n + 1; ++i) {
    if (a.find(i) == a.end())
      d[i] = 0;
    else if (i > 2)
      d[i - 1] = (d[i - 2] + d[i - 3]) % MOD;
    else
      d[i - 1] = d[i - 2];
  }
  cout << d[n - 1] << '\n';
  return 0;
}
