#include <bits/stdc++.h>
using namespace std;
void Freopen() {
  freopen(
      "mao"
      ".in",
      "r", stdin);
  freopen(
      "mao"
      ".out",
      "w", stdout);
}
int read() {
  int g = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || '9' < ch) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    g = g * 10 + ch - '0';
    ch = getchar();
  }
  return g * f;
}
const int N = 150005;
int pre[N], n, m, vis[N], ans, f[N << 3][4], maxn;
int d(int L, int R) { return pre[R] - pre[L - 1]; }
void solve(int v, int L, int R) {
  if (L + 1 == R) {
    if (d(L, R)) ans++;
    return void();
  }
  if (L + 3 == R) {
    if (d(L, R) == 1) f[v][1] = 1, f[v][2] = 2;
    if (d(L, R) >= 2) f[v][3] = 3;
    int mid = L + R >> 1;
    solve(v << 1, L, mid), solve(v << 1 | 1, mid + 1, R);
    return void();
  }
  int mid = L + R >> 1;
  solve(v << 1, L, mid), solve(v << 1 | 1, mid + 1, R);
  for (int o1 = (0); o1 <= (3); o1++)
    if (o1 == 0 || f[v << 1][o1])
      for (int o2 = (0); o2 <= (3); o2++)
        if (o2 == 0 || f[v << 1 | 1][o2]) {
          f[v][o1 | o2] =
              max(f[v][o1 | o2], f[v << 1][o1] + f[v << 1 | 1][o2] + (o1 | o2));
        }
}
signed main() {
  n = read(), m = read(), maxn = 1 << n;
  for (int i = (1); i <= (m); i++) vis[read()] = 1;
  for (int i = (1); i <= (maxn); i++) pre[i] = pre[i - 1] + vis[i];
  solve(1, 1, maxn);
  cout << ans + (pre[maxn] > 0) +
              max(f[1][0], max(f[1][1], max(f[1][2], f[1][3])));
  return signed();
}
