#include <bits/stdc++.h>
using std::cerr;
using std::cin;
using std::max;
using std::min;
int n, m, a[5000000], ans, all, fa[5000000], st, f1, f2, v[5000000],
    isp[5000000];
int find(int x) { return fa[x] ^ x ? fa[x] = find(fa[x]) : x; }
void dfs(int x) {
  if (v[x]) return;
  v[x] = st;
  if (isp[x]) {
    f2 = find(isp[x]);
    if (f1 ^ f2) fa[f2] = f1;
    dfs(all ^ x);
  }
  for (int i = 0; i < m; i++)
    if (x >> i & 1) dfs(x ^ (1 << i));
}
inline void solve() {
  for (int i = 1; i <= n; i++) st = i, f1 = find(i), dfs(all ^ a[i]);
  for (int i = 1; i <= n; i++) ans += find(i) == i;
}
int main() {
  scanf("%d%d", &m, &n), all = (1 << m) - 1;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), isp[a[i]] = i, fa[i] = i;
  solve();
  printf("%d\n", ans);
  return 0;
}
