#include <bits/stdc++.h>
using namespace std;
int n, k;
bool s[400005];
struct tr {
  int f[2][2];
  tr() { f[0][0] = f[0][1] = f[1][0] = f[1][1] = -1e8; }
};
void test(tr t) {
  cout << t.f[0][0] << "  " << t.f[0][1] << "  " << t.f[1][0] << "  "
       << t.f[1][1] << endl;
}
tr operator+(const tr &l, const tr &r) {
  int a, b, c, d, w1, w2, w3, x, y;
  tr an;
  int sum = 0;
  for (int i = 0; i < 128; i++) {
    a = (i & 1), b = ((i >> 1) & 1), c = ((i >> 2) & 1), d = ((i >> 3) & 1);
    w1 = ((i >> 4) & 1), w2 = ((i >> 5) & 1), w3 = ((i >> 6) & 1);
    sum = 0;
    x = a;
    y = b;
    if (a | c) sum++;
    if (b | d) sum++;
    if (w2) y = d;
    if (w1) {
      x = c;
      if (a | y) sum++;
      if (w3) y = a;
    } else {
      if (c | y) sum++;
      if (w3) y = c;
    }
    an.f[x][y] = max(an.f[x][y], l.f[a][b] + r.f[c][d] + sum);
  }
  return an;
}
tr dfs(int l, int r) {
  if (r - l == 1) {
    tr t;
    if (s[l] && s[r])
      t.f[1][1] = 1;
    else if (s[l] || s[r])
      t.f[1][0] = t.f[0][1] = 1;
    else
      t.f[0][0] = 0;
    return t;
  }
  int mid = ((l + r) >> 1);
  tr t = dfs(l, mid) + dfs(mid + 1, r);
  return t;
}
int main() {
  scanf("%d%d", &n, &k);
  n = (1 << n);
  for (int i = 1; i <= k; i++) {
    int x;
    scanf("%d", &x);
    s[x] = 1;
  }
  tr an = dfs(1, n);
  int ans =
      max(max(an.f[0][0], an.f[1][1] + 1), max(an.f[1][0] + 1, an.f[0][1] + 1));
  printf("%d\n", ans);
  return 0;
}
