#include <bits/stdc++.h>
using namespace std;
int N, K;
int f[1 << 17][4], tag[1 << 17];
int main() {
  scanf("%d%d", &N, &K);
  for (int i = 1; i <= K; i++) {
    int x;
    scanf("%d", &x);
    tag[x - 1] = 1;
  }
  if (!K) {
    printf("0\n");
    return 0;
  }
  memset(f, -0x3f, sizeof(f));
  int cnt = 0;
  for (int i = 0; i < (1 << N); i += 2) cnt += tag[i] | tag[i | 1];
  for (int i = 0; i < (1 << (N - 1)); i++) {
    int num = tag[i << 1] + tag[i << 1 | 1];
    f[(1 << (N - 1)) + i][0] = 0;
    if (num >= 1) f[(1 << (N - 1)) + i][1] = f[(1 << (N - 1)) + i][2] = 0;
    if (num == 2) f[(1 << (N - 1)) + i][3] = 0;
  }
  for (int i = (1 << (N - 1)) - 1; i; i--) {
    for (int j = 0; j < 4; j++)
      for (int k = 0; k < 4; k++)
        f[i][j | k] =
            max(f[i][j | k], f[i << 1][j] + f[i << 1 | 1][k] + (j | k));
  }
  int mx = 0;
  for (int i = 0; i < 4; i++) mx = max(mx, f[1][i]);
  printf("%d\n", mx + cnt + 1);
  return 0;
}
