#include <bits/stdc++.h>
using namespace std;
int n, m, a[5000005], v[8500005], t, ans, f[5000005];
void DFS(int nod) {
  v[nod] = 1;
  if (nod <= m) {
    int i = a[nod] + m + 1;
    if (!v[i]) DFS(i);
  } else {
    int k = nod - m - 1;
    for (int j = 0; j < n; j++) {
      int i = (k | (1 << j)) + m + 1;
      if (!v[i]) DFS(i);
    }
    int i = f[t - k];
    if (i && !v[i]) DFS(i);
  }
}
int32_t main() {
  ios_base ::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  cin >> n >> m;
  t = (1 << n) - 1;
  for (int i = 1; i <= m; i++) {
    cin >> a[i];
    f[a[i]] = i;
  }
  for (int i = 1; i <= m; i++) {
    if (!v[i]) DFS(i), ans++;
  }
  cout << ans;
}
