#include <bits/stdc++.h>
#pragma target("avx")
#pragma optimize("O3")
#pragma optimize("unroll-loops")
constexpr double eps = 1e-9;
constexpr double pi = 3.141592653589793238462643383279;
using namespace std;
long long gcd(long long a, long long b) {
  if (a % b == 0)
    return (b);
  else
    return (gcd(b, a % b));
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long pow(long long x, long long n) {
  x %= 998244353;
  if (n == 0) return 1;
  if (n % 2 == 0)
    return (pow((x * x) % 998244353, n / 2) % 998244353);
  else
    return (x * pow(x, n - 1)) % 998244353;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (long long i = 0; i < m; i++) cin >> a[i];
  vector<int> dp(n + 1, 0);
  dp[0] = 1;
  for (long long i = 0; i < m; i++) dp[a[i]] = 0;
  vector<bool> pd(n + 1, true);
  for (long long i = 0; i < m; i++) pd[a[i]] = false;
  for (int i = 1; i <= n; i++) {
    if (pd[i] == true) {
      if (i == 1)
        dp[i] = 1;
      else
        dp[i] = dp[i - 1] + dp[i - 2];
    }
  }
  cout << dp[n] << endl;
}
