#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int main() {
  ll n, m;
  ll ans = 1;
  vector<ll> step(n + 1);
  for (ll i = 0; i < (n + 1); i++) {
    step.at(i) = i;
  }
  for (ll i = 0; i < (m); i++) {
    ll fall;
    cin >> fall;
    step.at(fall) = 0;
  }
  for (ll i = 1; i < n; i++) {
    if (i <= n - 3 && step.at(i + 1) != 0 && step.at(i + 2) != 0) {
      i += 2;
      ans *= 2;
    } else if (i <= n - 3 && step.at(i + 1) == 0 && step.at(i + 2) == 0) {
      i += 2;
      ans *= 0;
    }
  }
  cout << fixed << setprecision(15) << ans << endl;
}
