#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e7 + 20;
const int INF = 0x3f3f3f3f;
int mark[1 << 17], dp[18][1 << 17][2][2], n, k, tmp, ans;
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= k; i++) {
    scanf("%d", &tmp);
    mark[tmp - 1] = 1;
  }
  memset(dp, -INF, sizeof(dp));
  for (int i = 1; i <= n; i++) {
    if (i == 1) {
      for (int j = 0; j < (1 << n); j += 2) {
        dp[1][j][mark[j]][mark[j + 1]] = mark[j] | mark[j + 1];
        dp[1][j][mark[j + 1]][mark[j]] = mark[j] | mark[j + 1];
      }
      continue;
    }
    for (int j = 0; j < (1 << n); j += (1 << i)) {
      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));
              dp[i][j][x1][x2] = max(dp[i][j][x1][x2], cost + (x2 | y2));
              dp[i][j][x1][y1] = max(dp[i][j][x1][y1], cost + (x2 | y1));
              dp[i][j][x1][y2] = max(dp[i][j][x1][y2], cost + (x2 | y2));
              dp[i][j][x2][x1] = max(dp[i][j][x2][x1], cost + (x1 | y1));
              dp[i][j][x2][x1] = max(dp[i][j][x2][x1], cost + (x1 | y2));
              dp[i][j][x2][y1] = max(dp[i][j][x2][y1], cost + (x1 | y1));
              dp[i][j][x2][y2] = max(dp[i][j][x2][y2], cost + (x1 | y2));
            }
    }
  }
  ans = max(ans, dp[n][0][0][0]);
  ans = max(ans, dp[n][0][0][1] + 1);
  ans = max(ans, dp[n][0][1][0] + 1);
  ans = max(ans, dp[n][0][1][1] + 1);
  printf("%d\n", ans);
}
