#include <bits/stdc++.h>
using namespace std;
const int MAXN = (1 << 17) + 5;
char buf[1 << 12], *pp1 = buf, *pp2 = buf, nc;
int ny;
inline char gc() {
  return pp1 == pp2 &&
                 (pp2 = (pp1 = buf) + fread(buf, 1, 1 << 12, stdin), pp1 == pp2)
             ? EOF
             : *pp1++;
}
inline int read() {
  int x = 0;
  for (ny = 1; nc = gc(), (nc < 48 || nc > 57) && nc != EOF;)
    if (nc == 45) ny = -1;
  if (nc < 0) return nc;
  for (x = nc - 48; nc = gc(), 47 < nc && nc < 58 && nc != EOF;
       x = (x << 3) + (x << 1) + (nc ^ 48))
    ;
  return x * ny;
}
int n, k, a[MAXN], f[MAXN << 2][2][2];
inline void chk(int& x, int y) { x = max(x, y); }
inline void solve(int x, int l, int r) {
  if (r - l + 1 == 2) {
    f[x][a[l]][a[r]] = f[x][a[r]][a[l]] = a[l] | a[r];
    return;
  }
  int mid = l + r >> 1;
  solve(x << 1, l, mid), solve(x << 1 | 1, mid + 1, r);
  for (int a = (0); a <= (1); a++)
    for (int b = (0); b <= (1); b++)
      for (int c = (0); c <= (1); c++)
        for (int d = (0); d <= (1); d++) {
          chk(f[x][a][b], f[x << 1][a][c] + f[x << 1 | 1][b][d] + (a | b) +
                              (c | d) + (b | (c | d)));
          chk(f[x][a][c], f[x << 1][a][c] + f[x << 1 | 1][b][d] + (a | b) +
                              (c | d) + (b | c));
          chk(f[x][a][d], f[x << 1][a][c] + f[x << 1 | 1][b][d] + (a | b) +
                              (c | d) + (b | d));
          chk(f[x][b][a], f[x << 1][a][c] + f[x << 1 | 1][b][d] + (a | b) +
                              (c | d) + (a | (c | d)));
          chk(f[x][b][c], f[x << 1][a][c] + f[x << 1 | 1][b][d] + (a | b) +
                              (c | d) + (a | c));
          chk(f[x][b][d], f[x << 1][a][c] + f[x << 1 | 1][b][d] + (a | b) +
                              (c | d) + (a | d));
        }
}
int main() {
  n = read(), k = read(), memset(f, -0x3f, sizeof(f));
  for (int i = (1); i <= (k); i++) a[read()] = 1;
  solve(1, 1, 1 << n);
  int ans = 0;
  for (int i = (0); i <= (1); i++)
    for (int j = (0); j <= (1); j++) ans = max(ans, f[1][i][j] + (i | j));
  cout << ans << "\n";
  return 0;
}
