#include <bits/stdc++.h>
int a[(1 << 22) + 1];
int n, m;
bool vis[(1 << 22) + 1][2];
bool yes[(1 << 22) + 1];
int mask;
void dfs(int now, int p) {
  if (vis[now][p]) return;
  vis[now][p] = true;
  if (p == 0)
    dfs(now, 1);
  else {
    for (int j = 0; j < n; j++) {
      int jj = 1 << j;
      if (!(jj & now)) dfs(now | jj, 1);
    }
    if (yes[now ^ mask]) dfs(now ^ mask, 0);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  int ans = 0;
  for (int i = 0; i < (1 << n); i++) yes[i] = vis[i][0] = vis[i][1] = false;
  for (int i = 0; i < m; i++) {
    scanf("%d", &a[i]);
    yes[a[i]] = true;
  }
  mask = (1 << n) - 1;
  for (int i = 0; i < m; i++) {
    if (!vis[a[i]][0]) {
      ans++;
      dfs(a[i], 0);
    }
  }
  printf("%d\n", ans);
  return 0;
}
