#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = (1 << 22);
bool visit[N], present[N];
void dfs(int node) {
  if (visit[node]) return;
  visit[node] = 1;
  for (int i = 0; i < 22; i++)
    if ((1 << i) & node) {
      int child = node ^ (1 << i);
      dfs(child);
    }
  int temp = ((1 << 22) - 1) & (~node);
  if (present[node]) dfs(temp);
}
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    int val;
    scanf("%d", &val);
    present[val] = 1;
  }
  int ans = 0;
  for (int i = 0; i < N; i++)
    if (present[i] && visit[i] == 0) {
      ans++;
      dfs(i);
    }
  printf("%d", ans);
  return 0;
}
