#include <bits/stdc++.h>
using namespace std;
const int N = (1 << 22);
int a[N], p[N], n, m, ans = 0;
bool vis[2 * N];
void dfs(int u) {
  vis[u] = true;
  if (u < (1 << n)) {
    dfs(u + (1 << n));
    return;
  }
  int v = 2 * (1 << n) - u - 1;
  if (p[v] && !vis[v]) dfs(v);
  for (int i = 0; i < n; ++i) {
    if ((u >> i & 1)) continue;
    int v = u + (1 << i);
    if (vis[v]) continue;
    dfs(v);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &a[i]);
    p[a[i]] = i;
  }
  for (int i = 1; i <= m; ++i)
    if (!vis[a[i]]) {
      ans++;
      dfs(a[i]);
    }
  printf("%d", ans);
}
