#include <bits/stdc++.h>
using namespace std;
const int mn = 22, ms = 1 << mn;
int mk[ms], mkc[ms], rt[ms];
int rep[ms];
int root(int u) {
  if (u == rt[u]) return u;
  return rt[u] = root(rt[u]);
}
void conn(int u, int v) {
  u = root(u), v = root(v);
  if (u != v) rt[u] = v;
}
int main() {
  int n, m;
  cin >> n >> m;
  int comp = (1 << n) - 1;
  memset(rep, -1, sizeof rep);
  for (int i = 0; i < m; i++) {
    int a;
    scanf("%d", &a);
    mk[a] = 1;
    rep[a] = a;
    mkc[a ^ comp] = 1;
  }
  for (int i = 0; i < (1 << n); i++) {
    rt[i] = i;
  }
  for (int p = 0; p < n; p++) {
    for (int i = 0; i < (1 << n); i++) {
      if (!((i >> p) & 1)) {
        mkc[i] |= mkc[i ^ (1 << p)];
      }
    }
  }
  for (int p = 0; p < n; p++) {
    for (int i = 0; i < (1 << n); i++) {
      if (!mkc[i]) continue;
      if ((i >> p) & 1) {
        int a = rep[i], b = rep[i ^ (1 << p)];
        if (a == -1) {
          rep[i] = b;
        } else if (b != -1) {
          conn(a, b);
        }
      }
    }
  }
  for (int i = 0; i < (1 << n); i++) {
    if (!mk[i ^ comp]) continue;
    if (rep[i] != -1) {
      conn(i ^ comp, rep[i]);
    }
  }
  set<int> s;
  for (int i = 0; i < (1 << n); i++) {
    if (mk[i]) {
      s.insert(root(i));
    }
  }
  cout << s.size() << endl;
  return 0;
}
