#include <bits/stdc++.h>
using namespace std;
const int maxm = (1 << 22) + 5;
int n, m, num_links;
bool active[maxm], vis[maxm], is_root[maxm];
int a[maxm], par[maxm], rnk[maxm];
void init_uf() {
  for (int i = 0; i < maxm; i++) {
    par[i] = i;
  }
}
int root(int u) {
  if (par[u] == u) {
    return u;
  }
  par[u] = root(par[u]);
  return par[u];
}
void link(int u, int v) {
  int ru = root(u);
  int rv = root(v);
  if (ru != rv) {
    if (rnk[ru] < rnk[rv]) {
      par[ru] = rv;
    } else {
      par[rv] = ru;
    }
    if (rnk[ru] == rnk[rv]) {
      ++rnk[ru];
    }
  }
}
bool go_down(int cur, int connect_to) {
  if (vis[cur]) {
    if (active[cur]) {
      link(cur, connect_to);
    }
    return active[cur];
  }
  vis[cur] = true;
  for (int i = 0; i < n; i++) {
    int pos = 1 << i;
    if (cur & pos) {
      active[cur] |= go_down(cur ^ pos, connect_to);
    }
  }
  if (active[cur]) {
    link(cur, connect_to);
  }
  return active[cur];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  init_uf();
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    active[a[i]] = true;
  }
  for (int i = 0; i < m; i++) {
    go_down(~a[i] & ((1 << n) - 1), a[i]);
  }
  for (int i = 0; i < m; i++) {
    is_root[root(a[i])] = true;
  }
  int res = 0;
  for (int i = 0; i < maxm; i++) {
    if (is_root[i]) {
      ++res;
    }
  }
  cout << res << '\n';
  return 0;
}
