#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 22;
int a, b, c, s[N], ans, mx;
bool vis[N];
vector<int> st[N];
inline int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * w;
}
inline void dfs(int n) {
  vis[n] = 1;
  if (st[n].size() && (!vis[st[n][0]])) dfs(st[n][0]);
  for (register int i = 1; i <= a; i++) {
    if (!(n & (1 << (i - 1)))) continue;
    int p = n ^ (1 << (i - 1));
    if (!vis[p]) dfs(p);
  }
}
signed main() {
  a = read(), b = read();
  mx = (1 << a) - 1;
  for (register int i = 1; i <= b; i++) {
    s[i] = read();
    st[s[i]].push_back(s[i] ^ mx);
  }
  for (register int i = 1; i <= b; i++) {
    if (vis[s[i]]) continue;
    dfs(s[i] ^ mx);
    ans++;
  }
  printf("%d", ans);
  return 0;
}
