#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, a[200500], f[20][200050][4], res;
int main() {
  scanf("%d%d", &n, &m);
  if (!m) {
    puts("0");
    return 0;
  }
  for (i = 1; i <= m; i++) {
    scanf("%d", &k);
    a[k] = 1;
  }
  memset(f, -10, sizeof(f));
  for (i = 1; i < (1 << n); i += 2) {
    if (a[i] + a[i + 1] == 2) {
      f[n][(i + 1) / 2][3] = 1;
    }
    if (a[i] + a[i + 1] == 1) {
      f[n][(i + 1) / 2][1] = f[n][(i + 1) / 2][2] = 1;
    }
    f[n][(i + 1) / 2][0] = 0;
  }
  for (i = n - 1; i >= 1; i--) {
    for (j = 1; j <= (1 << (i - 1)); j++) {
      f[i][j][0] = 0;
      f[i][j][1] =
          max(f[i][j][1], f[i + 1][j * 2][1] + f[i + 1][j * 2 - 1][0] + 1);
      f[i][j][1] =
          max(f[i][j][1], f[i + 1][j * 2][0] + f[i + 1][j * 2 - 1][1] + 1);
      f[i][j][2] =
          max(f[i][j][2], f[i + 1][j * 2][1] + f[i + 1][j * 2 - 1][0] + 2);
      f[i][j][2] =
          max(f[i][j][2], f[i + 1][j * 2][0] + f[i + 1][j * 2 - 1][1] + 2);
      f[i][j][2] =
          max(f[i][j][2], f[i + 1][j * 2][0] + f[i + 1][j * 2 - 1][2] + 2);
      f[i][j][2] =
          max(f[i][j][2], f[i + 1][j * 2][2] + f[i + 1][j * 2 - 1][0] + 2);
      f[i][j][2] =
          max(f[i][j][2], f[i + 1][j * 2][2] + f[i + 1][j * 2 - 1][2] + 2);
      f[i][j][3] =
          max(f[i][j][3], f[i + 1][j * 2][2] + f[i + 1][j * 2 - 1][1] + 3);
      f[i][j][3] =
          max(f[i][j][3], f[i + 1][j * 2][1] + f[i + 1][j * 2 - 1][2] + 3);
      f[i][j][3] =
          max(f[i][j][3], f[i + 1][j * 2][3] + f[i + 1][j * 2 - 1][0] + 3);
      f[i][j][3] =
          max(f[i][j][3], f[i + 1][j * 2][3] + f[i + 1][j * 2 - 1][1] + 3);
      f[i][j][3] =
          max(f[i][j][3], f[i + 1][j * 2][3] + f[i + 1][j * 2 - 1][2] + 3);
      f[i][j][3] =
          max(f[i][j][3], f[i + 1][j * 2][0] + f[i + 1][j * 2 - 1][3] + 3);
      f[i][j][3] =
          max(f[i][j][3], f[i + 1][j * 2][1] + f[i + 1][j * 2 - 1][3] + 3);
      f[i][j][3] =
          max(f[i][j][3], f[i + 1][j * 2][2] + f[i + 1][j * 2 - 1][3] + 3);
      f[i][j][3] =
          max(f[i][j][3], f[i + 1][j * 2][3] + f[i + 1][j * 2 - 1][3] + 3);
    }
  }
  res = max({f[1][1][1], f[1][1][2], f[1][1][3]}) + 1;
  printf("%d", res);
}
