#include <bits/stdc++.h>
using namespace std;
constexpr auto INF = 1000000000;
constexpr auto mod = 1000000007;
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  if (b == 0) return a;
  return gcd(b, a % b);
}
int n, q;
vector<long long> seg, lazy;
void aaa(int k) {
  if (lazy[k] == 0) return;
  if (k < n - 1) {
    lazy[k * 2 + 1] += lazy[k];
    lazy[k * 2 + 2] += lazy[k];
  }
  seg[k] += lazy[k];
  lazy[k] = 0;
}
void update(int a, int b, long long x, int k, int l, int r) {
  aaa(k);
  if (a <= l && b >= r) {
    lazy[k] += x;
    aaa(k);
  } else if (a < r && l < b) {
    update(a, b, x, k * 2 + 1, l, (l + r) / 2);
    update(a, b, x, k * 2 + 2, (l + r) / 2, r);
    seg[k] = seg[k * 2 + 1] + seg[k * 2 + 2];
  }
}
long long query(int a, int b, int k, int l, int r) {
  aaa(k);
  if (l >= b || r <= a) return 0;
  if (a <= l && b >= r) {
    return seg[k];
  }
  long long v1 = query(a, b, k * 2 + 1, l, (l + r) / 2);
  long long v2 = query(a, b, k * 2 + 2, (l + r) / 2, r);
  return v1 + v2;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> dp(100001, 0);
  for (int i = (0); i < (m); i++) {
    int a;
    cin >> a;
    dp[a - 1] = -1;
  }
  if (dp[0] != -1) {
    dp[0] = 1;
    if (dp[1] != -1) dp[1] = 2;
  } else {
    if (dp[1] != -1) dp[1] = 1;
  }
  for (int i = (2); i < (n); i++) {
    if (dp[i] == -1) continue;
    if (dp[i - 1] != -1) dp[i] += dp[i - 1];
    if (dp[i - 2] != -1) dp[i] += dp[i - 2];
  }
  cout << dp[n - 1] << endl;
  return 0;
}
