#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  x = 0;
  int p = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') p = -p;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + (ch - '0'), ch = getchar();
  x = x * p;
}
int n, k, val[1 << 17], tot, dp[20][1 << 16][2][2], vis[1 << 17], ans,
    now[3][3];
inline void getmax(int &x, int y) { x = x < y ? y : x; }
int main() {
  read(n);
  read(k);
  for (int i = 0; i < k; ++i) read(val[i]), vis[val[i] - 1] = 1;
  sort(val, val + k);
  tot = (1 << (n - 1));
  memset(dp, -0x3f3f3f, sizeof(dp));
  ans = 0;
  for (int i = 0; i < (1 << (n - 1)); ++i) {
    if (vis[i << 1] || vis[i << 1 | 1]) {
      if (vis[i << 1] && vis[i << 1 | 1])
        dp[0][i][1][1] = 1;
      else
        dp[0][i][0][1] = dp[0][i][1][0] = 1;
    } else
      dp[0][i][0][0] = 0;
  }
  for (int i = 1; i < n; ++i) {
    for (int j = 0; j < (1 << (n - i - 1)); ++j) {
      memset(now, -0x3f3f3f, sizeof(now));
      for (int a1 = 0; a1 < 2; ++a1) {
        for (int a2 = 0; a2 < 2; ++a2) {
          for (int b1 = 0; b1 < 2; ++b1) {
            for (int b2 = 0; b2 < 2; ++b2) {
              getmax(now[a1 + b1][a2 + b2],
                     dp[i - 1][j << 1][a1][a2] + dp[i - 1][j << 1 | 1][b1][b2] +
                         (a1 + b1 != 0) + (a2 + b2 != 0));
            }
          }
        }
      }
      for (int a = 0; a <= 2; ++a) {
        for (int b = 0; b <= 2; ++b) {
          if (a) getmax(dp[i][j][a - 1 > 0 ? 1 : 0][1], now[a][b] + 1);
          getmax(dp[i][j][a > 0 ? 1 : 0][b > 0 ? 1 : 0], now[a][b] + (b > 0));
        }
      }
    }
  }
  for (int a = 0; a <= 1; ++a) {
    for (int b = 0; b <= 1; ++b) {
      ans = max(ans, dp[n - 1][0][a][b] + (a + b > 0 ? 1 : 0));
    }
  }
  cout << ans << endl;
}
