#include <bits/stdc++.h>
using namespace std;
const int N = 5e6 + 12;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  return x * f;
}
int n, m, ans, len, h, t, q[N], a[N];
bool vis[N] = {false}, cnt[N] = {false};
void dfs(int u) {
  if (vis[u]) return;
  if (cnt[u]) q[++t] = u;
  vis[u] = true;
  int l = 0;
  while (u) {
    dfs(u - (u & -u) + l);
    l += u & -u;
    u -= u & -u;
  }
}
int main() {
  n = read();
  m = read();
  len = (1 << n) - 1;
  for (int i = 1; i <= m; i++) cnt[a[i] = read()] = true;
  h = 1;
  t = 0;
  for (int i = 1; i <= m; i++) {
    if (!vis[a[i]]) {
      ++ans;
      dfs(a[i] ^ len);
    }
    while (h <= t) dfs(q[h++] ^ len);
  }
  printf("%d", ans);
  return 0;
}
