#include <bits/stdc++.h>
using namespace std;
const int maxn = ((1 << 17) + 1000);
int n, k, fans[maxn];
int dp[18][maxn][2][2];
void init() {
  for (int i = 0; i < 18; i++) {
    for (int j = 0; j < maxn; j++) {
      for (int k = 0; k < 2; k++) {
        for (int z = 0; z < 2; z++) {
          dp[i][j][k][z] = -1e9;
        }
      }
    }
  }
}
int main() {
  init();
  cin >> n >> k;
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    fans[x - 1] = 1;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < (1 << n); j += (1 << i)) {
      if (i == 1) {
        for (int x1 = 0; x1 < 2; x1++) {
          for (int y1 = 0; y1 < 2; y1++) {
            if (x1 + y1 == fans[j] + fans[j + 1]) {
              dp[i][j][x1][y1] = ((fans[j] + fans[j + 1]) > 0 ? 1 : 0);
            }
          }
        }
      } else {
        for (int x1 = 0; x1 < 2; x1++) {
          for (int y1 = 0; y1 < 2; y1++) {
            for (int x2 = 0; x2 < 2; x2++) {
              for (int y2 = 0; y2 < 2; y2++) {
                int cost = dp[i - 1][j][x1][y1] +
                           dp[i - 1][j + (1 << (i - 1))][x2][y2];
                if (x1 || x2) cost++;
                if (y1 || y2) cost++;
                dp[i][j][x1][x2] =
                    max(dp[i][j][x1][x2], cost + ((x2 + y1) > 0 ? 1 : 0));
                dp[i][j][x1][y1] =
                    max(dp[i][j][x1][y1], cost + ((x2 + y1) > 0 ? 1 : 0));
                dp[i][j][x1][x2] =
                    max(dp[i][j][x1][x2], cost + ((x2 + y2) > 0 ? 1 : 0));
                dp[i][j][x1][y2] =
                    max(dp[i][j][x1][y2], cost + ((x2 + y2) > 0 ? 1 : 0));
                dp[i][j][x2][x1] =
                    max(dp[i][j][x2][x1], cost + ((x1 + y2) > 0 ? 1 : 0));
                dp[i][j][x2][y2] =
                    max(dp[i][j][x2][y2], cost + ((x1 + y2) > 0 ? 1 : 0));
                dp[i][j][x2][x1] =
                    max(dp[i][j][x2][x1], cost + ((x1 + y1) > 0 ? 1 : 0));
                dp[i][j][x2][y1] =
                    max(dp[i][j][x2][y1], cost + ((x1 + y1) > 0 ? 1 : 0));
              }
            }
          }
        }
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      int cost = dp[n][0][i][j];
      if (i + j > 0) cost++;
      ans = max(ans, cost);
    }
  }
  cout << ans << endl;
}
