#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
signed main() {
  ll n, m;
  cin >> n >> m;
  vector<bool> broken(n + 10, false);
  for (int i = 0; i < (m); ++i) {
    ll a;
    cin >> a;
    broken[a] = true;
  }
  vector<ll> dp(n + 10, 0);
  const ll MOD = (ll)1e9 + 7;
  dp[0] = 1LL;
  dp[1] = (broken[1] ? 0LL : 1LL);
  for (int i = 2; i <= n; ++i) {
    if (broken[i]) continue;
    dp[i] = dp[i - 1] % MOD + dp[i - 2] % MOD;
  }
  cout << dp[n] << endl;
  return 0;
}
