#include <bits/stdc++.h>
using namespace std;
template <typename T>
void maxtt(T& t1, T t2) {
  t1 = max(t1, t2);
}
template <typename T>
void mintt(T& t1, T t2) {
  t1 = min(t1, t2);
}
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "URDL";
const long long MOD2 = (long long)1000000007 * (long long)1000000007;
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int& x, int y, int mod = 1000000007) {
  x += y;
  if (x >= mod) x -= mod;
  if (x < 0) x += mod;
  assert(x >= 0 && x < mod);
}
void et(int x = -1) {
  printf("%d\n", x);
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 1000000007) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) { return y ? gcd1(y, x % y) : x; }
bool a[(1 << 17) + 135];
int dp[20][(1 << 17) + 135][2][2];
void fmain(int tid) {
  scanf("%d%d", &n, &k);
  for (int(i) = 1; (i) <= (int)(k); (i)++) {
    scanf("%d", &m);
    a[m] = 1;
  }
  for (int(i) = 0; (i) < (int)(20); (i)++)
    for (int(j) = 0; (j) < (int)((1 << n) + 5); (j)++)
      for (int(x1) = 0; (x1) < (int)(2); (x1)++)
        for (int(y1) = 0; (y1) < (int)(2); (y1)++)
          dp[i][j][x1][y1] = -(1000000000);
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    for (int j = 1; j <= (1 << n); j += (1 << i)) {
      if (i == 1) {
        dp[i][j][a[j]][a[j + 1]] = a[j] | a[j + 1];
        dp[i][j][a[j + 1]][a[j]] = a[j] | a[j + 1];
      } else {
        for (int(x1) = 0; (x1) < (int)(2); (x1)++)
          for (int(y1) = 0; (y1) < (int)(2); (y1)++)
            for (int(x2) = 0; (x2) < (int)(2); (x2)++)
              for (int(y2) = 0; (y2) < (int)(2); (y2)++) {
                int cc = dp[i - 1][j][x1][y1] +
                         dp[i - 1][j + (1 << (i - 1))][x2][y2];
                cc += x1 | x2;
                cc += y1 | y2;
                maxtt(dp[i][j][x1][x2], cc + (x2 | y1 | y2));
                maxtt(dp[i][j][x1][y1], cc + (x2 | y1));
                maxtt(dp[i][j][x1][y2], cc + (x2 | y2));
                maxtt(dp[i][j][x2][x1], cc + (x1 | y1 | y2));
                maxtt(dp[i][j][x2][y1], cc + (x1 | y1));
                maxtt(dp[i][j][x2][y2], cc + (x1 | y2));
              }
      }
    }
  }
  int ans = 0;
  for (int(x1) = 0; (x1) < (int)(2); (x1)++)
    for (int(y1) = 0; (y1) < (int)(2); (y1)++)
      maxtt(ans, dp[n][1][x1][y1] + (x1 | y1));
  printf("%d\n", ans);
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
