#include <bits/stdc++.h>
using namespace std;
const int M = (1 << 22) + 10;
int pos[M], par[M], rnk[M], lazy[M];
int fnd(int u) {
  if (par[u] == u) return u;
  return par[u] = fnd(par[u]);
}
void join(int a, int b) {
  a = fnd(a), b = fnd(b);
  if (a != b) {
    if (rnk[a] < rnk[b])
      swap(a, b);
    else if (rnk[a] == rnk[b])
      rnk[a]++;
    par[b] = a;
  }
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int first;
    scanf("%d", &first);
    pos[first] = par[i] = i;
  }
  for (int i = 0; i < (1 << n); i++) {
    int k = i ^ ((1 << n) - 1);
    if (pos[i]) {
      if (pos[k]) join(pos[k], pos[i]);
      lazy[k] = pos[i];
    }
  }
  for (int i = (1 << n) - 1; i >= 0; i--) {
    for (int j = 0; j < n; j++)
      if (!(i & (1 << j))) {
        int k = i | (1 << j);
        if (lazy[k]) {
          if (pos[i]) join(lazy[k], pos[i]);
          lazy[i] = lazy[k];
        }
      }
  }
  int ans = 0;
  for (int i = 1; i <= m; i++) {
    ans += (fnd(i) == i);
  }
  printf("%d\n", ans);
  return 0;
}
