#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1LL << 60;
const ll MOD7 = 1000000007;
ll dp[100010];
int main() {
  ll N, M;
  cin >> N >> M;
  vector<ll> vec(M);
  for (ll i = 0; i < M; i++) {
    cin >> vec[i];
    if (i > 0) {
      if (vec[i] - vec[i - 1] == 1) {
        cout << 0 << "\n";
        return 0;
      }
    }
  }
  for (ll i = 0; i < 100010; i++) dp[i] = 0;
  dp[0] = 0;
  dp[1] = 1;
  vector<ll> stairs(N + 1, 1);
  stairs[0] = 0;
  for (ll i = 0; i < M; i++) stairs[vec[i]] = 0;
  for (ll i = 2; i <= N; ++i) {
    if (stairs[i]) {
      dp[i] = dp[i - 1] + stairs[i - 1] + stairs[i - 2];
    }
  }
  cout << dp[N] << "\n";
  return 0;
}
