#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 22;
int n, m, maxn, ans, cnt;
int head[N], vis[N], a[N];
struct nood {
  int nex, to;
} e[N];
inline void add_edge(int u, int v) {
  e[++cnt].nex = head[u];
  head[u] = cnt;
  e[cnt].to = v;
}
inline void dfs(int u) {
  vis[u] = 1;
  for (int i = head[u]; i; i = e[i].nex) {
    int v = e[i].to;
    if (!vis[v]) dfs(v);
  }
  for (int i = 1; i <= n; i++)
    if (u & (1 << (i - 1))) {
      int now = u ^ (1 << (i - 1));
      if (!vis[now]) dfs(now);
    }
}
inline int read() {
  int sum = 0;
  char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) sum = sum * 10 + (ch ^ 48), ch = getchar();
  return sum;
}
int main() {
  n = read(), m = read();
  maxn = (1 << n) - 1;
  for (int i = 1; i <= m; i++) a[i] = read(), add_edge(a[i], a[i] ^ maxn);
  for (int i = 1; i <= m; i++)
    if (!vis[a[i]]) {
      vis[a[i]] = 1;
      dfs(a[i] ^ maxn);
      ans++;
    }
  printf("%d\n", ans);
  return 0;
}
