#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  vector<bool> pref(1 << n);
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    pref[x - 1] = true;
  }
  const int oo = -1;
  vector<vector<vector<int>>> dp(
      4, vector<vector<int>>(n + 1, vector<int>(1 << n, oo)));
  for (int i = 0; i < (1 << n); i += 2) {
    if (pref[i] && pref[i + 1])
      dp[3][1][i] = 1;
    else if (pref[i] || pref[i + 1])
      dp[1][1][i] = dp[2][1][i] = 1;
    else
      dp[0][1][i] = 0;
  }
  for (int i = 2; i <= n; i++)
    for (int j = 0; j < (1 << n); j += (1 << i))
      for (int p = 0; p < 4; p++)
        for (int q = 0; q < 4; q++)
          if (dp[p][i - 1][j] != -1 && dp[q][i - 1][j + (1 << (i - 1))] != -1) {
            int t = dp[p][i - 1][j] + dp[q][i - 1][j + (1 << (i - 1))];
            int upper = ((p & 2) > 0) + ((q & 2) > 0);
            int lower = ((p & 1) + (q & 1));
            if (upper == 2) {
              t += (lower > 0) + 2;
              dp[3][i][j] = max(dp[3][i][j], t);
              if (lower < 2) dp[2][i][j] = max(dp[2][i][j], t);
            } else if (upper == 1) {
              t += (lower > 0) + 1;
              if (lower == 0) {
                dp[2][i][j] = max(dp[2][i][j], t);
                dp[1][i][j] = max(dp[1][i][j], t + 1);
                dp[0][i][j] = max(dp[0][i][j], t + 1);
              }
              if (lower == 1) {
                dp[3][i][j] = max(dp[3][i][j], t + 1);
                dp[2][i][j] = max(dp[2][i][j], t + 1);
                dp[1][i][j] = max(dp[1][i][j], t + 1);
                dp[0][i][j] = max(dp[0][i][j], t + 1);
              }
              if (lower == 2) {
                dp[3][i][j] = max(dp[3][i][j], t + 1);
                dp[2][i][j] = max(dp[2][i][j], t + 1);
                dp[1][i][j] = max(dp[1][i][j], t + 1);
              }
            } else if (upper == 0) {
              t += (lower > 0);
              if (lower == 0) dp[0][i][j] = max(dp[0][i][j], t);
              if (lower == 1) {
                dp[1][i][j] = max(dp[1][i][j], t + 1);
                dp[0][i][j] = max(dp[0][i][j], t + 1);
              }
              if (lower == 2) {
                dp[1][i][j] = max(dp[1][i][j], t + 1);
                dp[0][i][j] = max(dp[0][i][j], t + 1);
              }
            }
          }
  int ans = 0;
  for (int p = 0; p < 4; p++) ans = max(dp[p][n][0] + (p > 0), ans);
  cout << ans << '\n';
  return 0;
}
