#include <bits/stdc++.h>
using namespace std;
const int N = 24, M = (1 << 22) + 10;
int two[N], f[M], fa[M], a[M], p[M], bz[M], n, m;
int gf(int x) {
  if (!fa[x]) return x;
  fa[x] = gf(fa[x]);
  return fa[x];
}
void mer(int x, int y) {
  int x1 = gf(x), y1 = gf(y);
  fa[x1] = y1;
  return;
}
void dfs(int x, int y) {
  if (!f[x]) return;
  if (gf(x) == gf(y)) return;
  mer(x, y);
  for (int j = 0; j <= n - 1; j++)
    if (x & two[j]) dfs(x ^ two[j], y);
}
int main() {
  scanf("%d%d", &n, &m);
  two[0] = 1;
  for (int i = 1; i <= n + 1; i++) two[i] = two[i - 1] * 2;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &a[i]);
    f[a[i]] = 1;
    p[a[i]] = i;
  }
  for (int i = 0; i <= two[n] - 1; i++) {
    for (int j = 0; j < n; j++) {
      if (i & two[j]) f[i] |= f[i ^ two[j]];
    }
  }
  int ans = 0;
  for (int i = 1; i <= m; i++) dfs((two[n] - 1) ^ a[i], a[i]);
  for (int i = 1; i <= m; i++) {
    int y = gf(a[i]);
    if (!bz[y]) ans++, bz[y] = true;
  }
  printf("%d", ans);
  return 0;
}
