#include <bits/stdc++.h>
using namespace std;
const int maxM = 1 << 22;
bool vis[maxM], tbv[maxM];
int n, M;
void dfs(int v) {
  vis[v] = true;
  int inv = ~v & M;
  if (tbv[inv]) {
    tbv[inv] = false;
    dfs(inv);
  }
  for (int i = 0; i < n; i++) {
    int m = v | 1 << i;
    if (!vis[m]) dfs(m);
  }
}
int main() {
  int m;
  scanf("%d%d", &n, &m);
  M = (1 << n) - 1;
  while (m--) {
    int a;
    scanf("%d", &a);
    tbv[a] = true;
  }
  int res = 0;
  for (int i = 0; i <= M; i++)
    if (tbv[i]) dfs(i), res++;
  printf("%d\n", res);
  return 0;
}
