#include <bits/stdc++.h>
using namespace std;
const int maxn = (1 << 17) + 5;
int dp[maxn * 4][2][2];
int val[maxn], n, k, x;
void dfs(int k, int l, int r) {
  int mid = l + r >> 1;
  int res = 0;
  if (l + 1 == r) {
    if (val[l] + val[r] == 0) {
      dp[k][0][0] = 0;
    } else if (val[l] + val[r] == 1) {
      dp[k][0][1] = dp[k][1][0] = 1;
    } else if (val[l] + val[r] == 2) {
      dp[k][1][1] = 1;
    }
  } else {
    dfs(k << 1, l, mid);
    dfs(k << 1 | 1, mid + 1, r);
    for (int i = 0; i <= 15; i++) {
      int a[2] = {i >> 0 & 1, i >> 1 & 1}, b[2] = {i >> 2 & 1, i >> 3 & 1};
      if (dp[k << 1][a[0]][b[0]] == -1 || dp[k << 1 | 1][a[1]][b[1]] == -1)
        continue;
      int base = dp[k << 1][a[0]][b[0]] + dp[k << 1 | 1][a[1]][b[1]] +
                 (a[0] | a[1]) + (b[0] | b[1]);
      for (int j = 0; j <= 7; j++) {
        int f[3] = {j >> 0 & 1, j >> 1 & 1, j >> 2 & 1}, w1, w2, l1, l2, w3;
        if (f[0])
          w1 = a[0], l1 = a[1];
        else
          w1 = a[1], l1 = a[0];
        if (f[1])
          w2 = b[0], l2 = b[1];
        else
          w2 = b[1], l2 = b[0];
        if (f[2])
          w3 = l1;
        else
          w3 = w2;
        dp[k][w1][w3] = max(dp[k][w1][w3], base + (l1 | w2));
      }
    }
  }
}
int main() {
  memset(dp, -1, sizeof(dp));
  cin >> n >> k;
  while (k--) {
    cin >> x;
    val[x] = 1;
  }
  dfs(1, 1, 1 << n);
  cout << max(max(dp[1][0][0], dp[1][0][1] + 1),
              max(dp[1][1][0], dp[1][1][1]) + 1)
       << "\n";
}
