#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
int n, k;
int a[200005];
struct st {
  int a[2][2];
  int* operator[](int x) { return a[x]; }
  void print() {
    cout << a[0][0] << ' ' << a[0][1] << ' ' << a[1][0] << ' ' << a[1][1]
         << endl;
  }
};
st solve(int l, int r) {
  if (r - l == 2) {
    st b;
    b[0][0] = b[0][1] = b[1][0] = b[1][1] = -inf;
    if (a[l] + a[l + 1] == 0) {
      b[0][0] = 0;
    } else if (a[l] + a[l + 1] == 1) {
      b[0][1] = 1;
      b[1][0] = 1;
    } else {
      b[1][1] = 1;
    }
    return b;
  }
  st p1 = solve(l, (l + r) / 2);
  st p2 = solve((l + r) / 2, r);
  st b;
  b[0][0] = b[0][1] = b[1][0] = b[1][1] = -inf;
  for (int l1 = 0; l1 < 2; l1++) {
    for (int l2 = 0; l2 < 2; l2++) {
      for (int r1 = 0; r1 < 2; r1++) {
        for (int r2 = 0; r2 < 2; r2++) {
          for (int op1 = 0; op1 < 2; op1++) {
            for (int op2 = 0; op2 < 2; op2++) {
              int cnt = 0;
              cnt += (l1 || r1);
              cnt += (l2 || r2);
              int win_l1_r1 = (op1 == 0 ? l1 : r1);
              int lose_l1_r1 = (op1 == 0 ? r1 : l1);
              cnt += (l2 || r2) || lose_l1_r1;
              int win = (op2 == 0 ? lose_l1_r1 : (l2 || r2));
              if (r - l == (1 << n)) cnt += (win_l1_r1 || win);
              b[win_l1_r1][win] =
                  max(b[win_l1_r1][win], p1[l1][l2] + p2[r1][r2] + cnt);
            }
          }
        }
      }
    }
  }
  return b;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= k; i++) {
    int x;
    scanf("%d", &x);
    a[x - 1] = 1;
  }
  st b = solve(0, 1 << n);
  cout << max(max(b[0][0], b[0][1]), max(b[1][0], b[1][1]));
  return 0;
}
