#include <bits/stdc++.h>
using namespace std;
const int N = (1 << 22) + 5;
long long mod = 1e9 + 7;
const int lim = 4e5 + 5;
const int lg = 22;
const int base = 311;
const long double eps = 1e-6;
long long cap[N], a[N], p[N];
long long find_set(long long u) {
  if (p[u] < 0) return u;
  return p[u] = find_set(p[u]);
}
void dsu(long long u, long long v) {
  u = find_set(u);
  v = find_set(v);
  if (u == v) return;
  if (p[u] > p[v]) swap(u, v);
  p[u] += p[v];
  p[v] = u;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  if (fopen("tests.inp", "r")) {
    freopen("tests.inp", "r", stdin);
    freopen("tests.out", "w", stdout);
  }
  long long n, m;
  cin >> n >> m;
  memset(cap, -1, sizeof(cap));
  memset(p, -1, sizeof(p));
  for (int i = 1; i <= m; i++) {
    cin >> a[i];
    cap[a[i]] = a[i];
  }
  for (int i = 0; i < (1 << n); i++) {
    if (cap[i] >= 0) continue;
    for (int j = 0; j < n; j++) {
      if (i & (1 << j)) {
        cap[i] = cap[i ^ (1 << j)];
        if (cap[i] >= 0) break;
      }
    }
  }
  long long fullmask = (1 << n) - 1;
  for (int i = 0; i < (1 << n); i++) {
    long long rev = fullmask ^ i;
    if (cap[i] == -1 || cap[rev] == -1) continue;
    dsu(cap[i], cap[rev]);
    for (int j = 0; j < n; j++) {
      if (i & (1 << j)) {
        if (cap[i ^ (1 << j)] >= 0) {
          dsu(cap[i], cap[i ^ (1 << j)]);
        }
      }
    }
  }
  map<long long, long long> mem;
  for (int i = 1; i <= m; i++) {
    mem[find_set(a[i])]++;
  }
  cout << mem.size();
}
