#include <bits/stdc++.h>
using namespace std;
long long mo(const long long input, const long long ceil) {
  return input >= ceil ? input % ceil : input;
}
const long long inf = 0x3f3f3f3f;
bool f[1 << 17];
long long dp[1 << 17][4];
void solve(long long tt) {
  long long n, k, a, ans;
  cin >> n >> k;
  for (long long i = 0; i < k; i++) {
    cin >> a;
    f[a - 1] = true;
  }
  for (long long i = (1 << (n - 1)); i < (1 << n); i++) {
    dp[i][0] = 0;
    if (f[(i - (1 << (n - 1))) * 2] || f[(i - (1 << (n - 1))) * 2 + 1]) {
      dp[i][1] = 1;
      dp[i][2] = 1;
    } else {
      dp[i][1] = -inf;
      dp[i][2] = -inf;
    }
    if (f[(i - (1 << (n - 1))) * 2] && f[(i - (1 << (n - 1))) * 2 + 1])
      dp[i][3] = 1;
    else
      dp[i][3] = -inf;
  }
  for (long long i = (1 << (n - 1)) - 1; i >= 1; i--) {
    for (long long j = 0; j < 4; j++) dp[i][j] = -inf;
    for (long long j = 0; j < 4; j++)
      for (long long k = 0; k < 4; k++)
        dp[i][j | k] =
            max(dp[i][j | k], dp[i << 1][j] + dp[i << 1 | 1][k] + (j | k));
  }
  ans = 0;
  for (long long i = 0; i < 4; i++) ans = max(ans, dp[1][i] + (i != 0));
  cout << ans << "\n";
  return;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long tt = 1;
  for (long long i = 0; i < tt; i++) solve(tt);
  cerr << "\n\n\nTime : "
       << 1000 * (long double)clock() / (long double)CLOCKS_PER_SEC << "ms\n";
  ;
  return 0;
}
