#include <bits/stdc++.h>
int n, m;
int a[((1 << 22) + 5)];
bool b[((1 << 22) + 5)], vis[((1 << 22) + 5)];
int q[((1 << 22) + 5)], l, r;
int ans;
int Read() {
  int res = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9') res = res * 10 + ch - '0', ch = getchar();
  return res;
}
int main() {
  n = Read();
  m = Read();
  for (int i = 1; i <= m; ++i) {
    a[i] = Read();
    b[a[i]] = 1;
  }
  int cur;
  const int lim = (1 << n) - 1;
  for (int i = 1; i <= m; ++i) {
    if (vis[a[i]]) continue;
    ++ans;
    l = r = 1;
    q[l] = lim ^ a[i];
    vis[a[i]] = vis[q[l]] = 1;
    while (l <= r) {
      if (b[q[l]]) {
        cur = lim ^ q[l];
        if (!vis[cur]) {
          q[++r] = cur;
          vis[cur] = 1;
        }
      }
      cur = q[l++];
      for (int j = 1; j <= lim; j <<= 1) {
        if (!(cur & j) || vis[cur - j]) continue;
        vis[cur - j] = 1;
        q[++r] = cur - j;
      }
    }
  }
  printf("%d", ans);
  return 0;
}
