#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 22 | 5;
int n, m, u, a[N];
bool o[N], e[N];
void dfs(int x) {
  if (o[x]) return;
  o[x] = 1;
  if (e[x]) {
    dfs((u - 1) ^ x);
  }
  for (int i = 0; i < n; i++)
    if (x >> i & 1) dfs(x ^ (1 << i));
}
int main() {
  cin >> n >> m;
  u = 1 << n;
  int ans = 0;
  for (int i = 1, x; i <= m; i++) scanf("%d", &x), e[a[i] = x] = 1;
  for (int i = 1; i <= m; i++)
    if (!o[a[i]]) dfs((u - 1) ^ a[i]), ++ans;
  cout << ans;
  return 0;
}
