#include <bits/stdc++.h>
using namespace std;
int const N = 1 << 22;
bool b[N], c[N], x[N], an[N];
int pa[N];
int P(int v) { return pa[v] >= 0 ? pa[v] = P(pa[v]) : v; }
void ad(int a, int b) {
  int x = P(a), y = P(b);
  if (x == y) return;
  pa[y] = x;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < (int)(1 << n); ++i) pa[i] = -1;
  for (int i = 0; i < (int)(m); ++i) {
    int t;
    scanf("%d", &t);
    x[t] = true;
    c[t] = true;
  }
  for (int i = 0; i < (int)(1 << n); ++i)
    for (int j = 0; j < (int)(n); ++j)
      if (i >> j & 1 && c[i ^ 1 << j]) c[i] = true;
  for (int i = 0; i < (int)(1 << n); ++i)
    if (x[i]) {
      int in = (1 << n) - 1 ^ i;
      if (!c[in]) continue;
      b[in] = true;
      ad(i, in);
    }
  for (int i = (1 << n) - 1; i >= 0; --i)
    if (b[i])
      for (int j = 0; j < (int)(n); ++j)
        if (i >> j & 1) {
          int k = i ^ 1 << j;
          if (!c[k]) continue;
          b[k] = true;
          ad(i, k);
        }
  for (int i = 0; i < (int)(1 << n); ++i)
    if (x[i]) an[P(i)] = true;
  int o = 0;
  for (int i = 0; i < (int)(1 << n); ++i)
    if (an[i]) ++o;
  printf("%d\n", o);
}
