#include <bits/stdc++.h>
using namespace std;
int n, k, dp[20][1 << 17][2][2], good[1 << 17];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> n >> k;
  if (k == 0) return cout << 0, 0;
  memset(&dp, -0x3f, sizeof(dp));
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    x--;
    good[x] = 1;
  }
  for (int i = 0; i + 1 < (1 << n); i += 2) {
    int a = good[i] + good[i + 1];
    dp[1][i][min(1, a)][0] = min(1, a);
    if (a) dp[1][i][min(1, a - 1)][1] = 1;
  }
  for (int h = 2; h <= n; h++) {
    for (int i = 0; i + (1 << h) - 1 < (1 << n); i += (1 << h)) {
      for (int al = 0; al < 2; al++) {
        for (int bl = 0; bl < 2; bl++) {
          for (int ar = 0; ar < 2; ar++) {
            for (int br = 0; br < 2; br++) {
              int l = dp[h - 1][i][al][bl];
              int r = dp[h - 1][i + (1 << (h - 1))][ar][br];
              int a = al + ar, b = bl + br;
              for (int j = 0; j < 2; j++) {
                if (a < j) continue;
                int A = min(1, a - j), B = min(1, b + j);
                int val = l + r + (al || ar) + (bl || br) + B;
                dp[h][i][A][B] = max(dp[h][i][A][B], val);
              }
            }
          }
        }
      }
    }
  }
  int ans = 0;
  for (int a = 0; a < 2; a++)
    for (int b = 0; b < 2; b++) ans = max(ans, dp[n][0][a][b]);
  cout << ans + 1;
}
