#include <bits/stdc++.h>
using namespace std;
const int bits = 22;
const int maxn = 1 << bits;
int u[maxn], sz[maxn], a[maxn];
void init() {
  for (int e = 0; e < maxn; e++) u[e] = e, sz[e] = 0;
}
int find(int x) {
  if (x == u[x]) return x;
  return u[x] = find(u[x]);
}
int m[maxn], v[maxn], s[maxn];
void join(int x, int y) {
  x = find(x);
  y = find(y);
  if (x ^ y) {
    u[x] = y;
    sz[y] += sz[x];
    sz[x] = 0;
  }
}
int n;
void dfs(int x, int conn) {
  v[x] = 1;
  int md = -1;
  if (m[x]) {
    join(x, conn);
    md = conn;
  }
  for (int e = 0; e < n; e++) {
    if (x & (1 << e)) {
      int u = x ^ (1 << e);
      if (!v[u]) dfs(u, conn);
      if (s[u] != -1) {
        join(s[u], conn);
        md = conn;
      }
    }
  }
  if (md != -1) s[x] = find(md);
}
int main() {
  init();
  int m;
  scanf("%d %d", &n, &m);
  int msk = (1 << n) - 1;
  for (int e = 0; e < m; e++) scanf("%d", a + e), sz[a[e]] = 1, ::m[a[e]] = 1;
  memset(s, -1, sizeof(s));
  for (int e = 0; e < m; e++) {
    dfs(msk ^ a[e], a[e]);
  }
  int occ = 0;
  for (int e = 0; e < 1 << n; e++) {
    if (u[e] == e && sz[e] > 0) occ++;
  }
  printf("%d\n", occ);
  return 0;
}
