#include <bits/stdc++.h>
using namespace std;
const int N = (1 << 18) + 7;
int n, k, a, f[N][5], s;
int main() {
  scanf("%d", &n), scanf("%d", &k);
  s = 1 << (n - 1);
  memset(f, -0x3f, sizeof(f));
  for (int i = 0; i <= (1 << 18); i++) f[i][0] = 0;
  for (int i = 1; i <= k; i++) {
    scanf("%d", &a);
    a = s + ((a - 1) >> 1);
    f[a][3] = f[a][1];
    f[a][1] = f[a][2] = 1;
  }
  for (int i = s - 1; i >= 1; i--) {
    for (int x = 0; x <= 3; x++) {
      for (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));
      }
    }
  }
  int ans = -1;
  for (int i = 1; i <= 3; i++) ans = max(ans, f[1][i]);
  printf("%d\n", ans + 1);
  return 0;
}
