#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0;
  int sign = 0;
  char c = getchar();
  for (; !isdigit(c); c = getchar()) {
    sign |= c == '-';
  }
  for (; isdigit(c); c = getchar()) {
    x = x * 10 + c - '0';
  }
  return sign ? -x : x;
}
const int ms = 1 << 22;
const int lim = (1 << 22) - 1;
int arr[ms], pai[ms], comps;
bool hav[ms];
bool vis[ms];
int find(int x) {
  if (x == pai[x]) return x;
  return pai[x] = find(pai[x]);
}
void unite(int x, int y) {
  x = find(x);
  y = find(y);
  if (x != y) {
    --comps;
    pai[x] = y;
  }
}
void dfs(int u, int mask) {
  if (hav[mask]) unite(u, mask);
  if (vis[mask]) return;
  vis[mask] = true;
  if (mask == 0) return;
  int last_bit = 31 - __builtin_clz(mask);
  for (int i = last_bit; i >= 0; --i) {
    int nmask = mask & (~(1 << i));
    dfs(u, nmask);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  iota(pai, pai + ms, 0);
  int n = read(), m = read();
  comps = m;
  for (int i = 0; i < m; ++i) {
    arr[i] = read();
    hav[arr[i]] = true;
  }
  for (int i = 0; i < m; ++i) {
    dfs(arr[i], ~arr[i] & lim);
  }
  cout << comps << '\n';
  return 0;
}
