#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1;
  } while (ch < '0' || ch > '9');
  do {
    x = x * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return x * f;
}
const int LOG = 22, N = 1 << 22 | 1;
int n, m, pre[N], low[N], lt, sccnode[N], scccnt, is[N], ans, a[N];
stack<int> s;
void dfs(int u) {
  pre[u] = low[u] = ++lt;
  s.push(u);
  for (int i = 0; i <= n; ++i) {
    if (i != n && (!(u & (1 << i)))) continue;
    if (i == n && !is[u]) continue;
    int v = u ^ (1 << i);
    if (i == n) v = (1 << n) - 1 - u;
    if (!pre[v]) {
      dfs(v);
      low[u] = min(low[u], low[v]);
    } else if (!sccnode[v])
      low[u] = min(low[u], pre[v]);
  }
  if (pre[u] == low[u]) {
    ++scccnt;
    bool flag = 0;
    while (!s.empty()) {
      int t = s.top();
      s.pop();
      sccnode[t] = scccnt;
      if (is[t]) flag = 1;
      if (u == t) break;
    }
    ans += flag;
  }
}
int main() {
  n = read(), m = read();
  for (int i = 1; i <= m; ++i) a[i] = read(), is[a[i]] = 1;
  for (int i = 1; i <= m; ++i)
    if (!pre[a[i]]) dfs(a[i]);
  printf("%d\n", ans);
  return 0;
}
