#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> t;
int n, k, d;
void dfs(int u) {
  if (u * 2 >= t.size()) return;
  dfs(u * 2);
  dfs(u * 2 + 1);
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (t[u * 2][i] == -1 || t[u * 2 + 1][j] == -1) continue;
      t[u][i | j] = max(t[u][i | j], t[u * 2][i] + t[u * 2 + 1][j] + (i | j));
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> k;
  d = 1 << (n - 1);
  t.assign(d << 1, vector<int>(4, -1));
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    x--;
    x /= 2;
    x += d;
    if (t[x][1] != -1) t[x][3] = 1;
    t[x][1] = 1;
    t[x][2] = 1;
  }
  for (int i = d; i < (d << 1); i++) {
    t[i][0] = 0;
    for (int j = 1; j < 4; j++) {
      if (t[i][j] != -1) {
        t[i][0] = -1;
      }
    }
  }
  dfs(1);
  cout << max(t[1][1], max(t[1][2], t[1][3])) + 1;
  return 0;
}
