#include <bits/stdc++.h>
using namespace std;
int id[10000000], edge, value[10000000], visit[10000000], n, tn;
int read() {
  int tmp = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') {
    tmp = tmp * 10 + c - '0';
    c = getchar();
  }
  return tmp;
}
void dfs(int cur) {
  if (visit[cur]) return;
  visit[cur] = 1;
  if (id[cur] && visit[id[cur]] == 0) {
    visit[id[cur]] = 1;
    dfs(tn - cur);
  }
  for (int i = 0; i <= n - 1; i++)
    if ((cur >> i) & 1) dfs(cur - (1 << i));
}
int main() {
  n = read();
  int m = read();
  tn = (1 << n) - 1;
  for (int i = 1; i <= m; i++) {
    value[i] = read();
    id[value[i]] = i + tn;
  }
  int res = 0;
  for (int i = 1; i <= m; i++)
    if (visit[tn + i] == 0) {
      res++;
      visit[tn + i] = 1;
      dfs(tn - value[i]);
    }
  printf("%d\n", res);
}
