#include <bits/stdc++.h>
using namespace std;
int maxi, elements[4201000], rank1[4201000], parents[4201000];
bool vis[(1 << 22) + 10], stats[(1 << 22) + 10];
int find(int n) {
  if (parents[n] == -1) return n;
  return parents[n] = find(parents[n]);
}
void join(int n1, int n2) {
  int s1 = find(n1), s2 = find(n2);
  if (s1 == s2) return;
  if (rank1[s1] < rank1[s2]) swap(s1, s2);
  parents[s2] = s1;
  rank1[s1] += rank1[s2] + 1;
}
void propagate(int mask, int n) {
  if (not vis[mask]) {
    vis[mask] = true;
    for (int i = 0; i <= 21; i++) {
      if (mask & (1 << i)) propagate(mask - (1 << i), n);
    }
  }
  if (stats[mask]) join(mask, n);
}
set<int> compos;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  memset(parents, -1, sizeof parents);
  for (int i = 0; i < m; i++) {
    scanf("%d", &elements[i]);
    stats[elements[i]] = true;
  }
  for (int i = 0; i <= 21; i++) maxi |= (1 << i);
  for (int i = 0; i < m; i++) propagate(elements[i] ^ maxi, elements[i]);
  for (int i = 0; i < m; i++) compos.insert(find(elements[i]));
  printf("%d\n", ((int)compos.size()));
  return 0;
}
