#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll inf = 1 << 20;
const vector<vector<int>> game = {{0}, {1, 2}, {1, 2}, {3}};
vector<int> win(int a, int b) { return game[(a & 2) | ((b >> 1) & 1)]; }
vector<int> lose(int a, int b) { return game[(a & 1) | ((b << 1) & 2)]; }
vector<int> mix(int a, int b) { return game[(a & 1) | (b & 2)]; }
int main() {
  int n, k;
  cin >> n >> k;
  set<int> fan;
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    fan.insert(x - 1);
  }
  vector<vector<ll>> dp(1 << (n - 1));
  for (int i = 0; i < dp.size(); i++) {
    bool t1 = fan.find(2 * i) != fan.end();
    bool t2 = fan.find(2 * i + 1) != fan.end();
    if (!t1 && !t2) dp[i] = {0, -inf, -inf, -inf};
    if (t1 != t2) dp[i] = {-inf, 1, 1, -inf};
    if (t1 && t2) dp[i] = {-inf, -inf, -inf, 1};
  }
  while (dp.size() > 1) {
    vector<vector<ll>> next(dp.size() / 2, {-inf, -inf, -inf, -inf});
    for (int i = 0; i < next.size(); i++) {
      for (int a = 0; a < 4; a++) {
        for (int b = 0; b < 4; b++) {
          for (int w : win(a, b)) {
            for (int l : lose(a, b)) {
              for (int m : mix(w, l)) {
                int result = (w & 2) | ((m & 2) >> 1);
                int extra = (w > 0 ? 1 : 0) + (l > 0 ? 1 : 0) + (m > 0 ? 1 : 0);
                next[i][result] =
                    max(-inf, max(next[i][result],
                                  dp[2 * i][a] + dp[2 * i + 1][b] + extra));
              }
            }
          }
        }
      }
    }
    dp = next;
  }
  ll result = 0;
  for (int i = 0; i < 4; i++) {
    result = max(result, dp[0][i] + (i > 0 ? 1 : 0));
  }
  cout << result << endl;
}
