#include <bits/stdc++.h>
using namespace std;
const unsigned _mod = 998244353;
const unsigned mod = 1e9 + 7;
const long long infi = 0x3f3f3f3f3f3f3f3fll;
const int inf = 0x3f3f3f3f;
long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long ksm(long long x, long long y) {
  long long ret = 1;
  while (y) {
    if (y & 1ll) ret = ret * x % mod;
    y >>= 1ll;
    x = x * x % mod;
  }
  return ret;
}
long long qpow(long long x, long long y) {
  long long ret = 1;
  while (y) {
    if (y & 1ll) ret = ret * x;
    y >>= 1ll;
    x = x * x;
  }
  return ret;
}
long long _gcd(long long x, long long y) { return y ? _gcd(y, x % y) : x; }
int n, k, a, f[300010][4];
int main() {
  cin >> n >> k;
  n = 1 << n - 1;
  for (register int i = 1; i <= 300000; ++i) f[i][1] = f[i][2] = f[i][3] = -inf;
  for (register int i = 1; i <= k; ++i) {
    a = read();
    a = n + (a - 1) / 2;
    f[a][3] = f[a][1], f[a][1] = f[a][2] = 1;
  }
  for (register int i = n - 1; i >= 1; --i)
    for (register int x = 0; x <= 3; ++x)
      for (register int y = 0; y <= 3; ++y)
        f[i][x | y] =
            max(f[i][x | y], f[i << 1][x] + f[i << 1 | 1][y] + (x | y));
  cout << max({f[1][1], f[1][2], f[1][3], -1}) + 1 << '\n';
  return 0;
}
