#include <bits/stdc++.h>
using namespace std;
const int N = (1 << 22) * 2 + 5, E = (1 << 22) * 2 + 5;
int n, m;
int a[N], ans, mx;
int vis[N];
int has[N];
void dfs(int x) {
  vis[x] = 1;
  if (x >= mx) {
    if (!has[x - mx]) return;
    ans--;
    int t = mx - 1 - (x - mx);
    if (!vis[t]) dfs(t);
  } else {
    for (int t = x; t; t -= ((t) & -(t)))
      if (!vis[x - ((t) & -(t))]) dfs(x - ((t) & -(t)));
    if (!vis[x + mx]) dfs(x + mx);
  }
}
int main() {
  cin >> n >> m;
  mx = 1 << n;
  for (int i = 1; i <= m; i++) scanf("%d", &a[i]), has[a[i]] = 1;
  ans = m;
  for (int i = 1; i <= m; i++)
    if (!vis[mx + a[i]]) ans++, dfs(mx + a[i]);
  cout << ans << endl;
}
