#include <bits/stdc++.h>
using namespace std;
const int LN = 22;
const int N = (1LL << LN) + 10;
int a[N];
int sos[N];
int n;
pair<int, int> dsu[N];
int con[N];
int find(int x) {
  if (dsu[x].first == x) return x;
  return dsu[x].first = find(dsu[x].first);
}
void merge(int u, int v) {
  int p = find(u);
  int q = find(v);
  if (p == q) return;
  if (dsu[p].second > dsu[q].second) swap(p, q);
  dsu[q].second += dsu[p].second;
  dsu[p].first = q;
}
int used[N];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, x;
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> a[i];
  int tot = (1 << n);
  int mask = tot - 1;
  for (int i = 0; i < tot; i++) dsu[i] = {i, 1};
  for (int i = 0; i < m; i++) sos[a[i]]++;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < tot; j++)
      if (j & (1 << i)) sos[j] += sos[j ^ (1 << i)];
  for (int i = 0; i < tot; i++)
    if (sos[i] > 0 && sos[i ^ mask] > 0) {
      merge(i, i ^ mask);
      con[i] = 1;
      con[i ^ mask] = 1;
    }
  for (int i = tot - 1; i >= 1; i--) {
    if (sos[i] == 0) continue;
    for (int j = 0; j < n; j++)
      if ((i & (1 << j)) == 0 && con[i ^ (1LL << j)]) {
        con[i] = 1;
        merge(i, i ^ (1LL << j));
      }
  }
  int res = 0;
  for (int i = 0; i < m; i++) used[find(a[i])] = 1;
  for (int i = 0; i < tot; i++) res += used[i];
  cout << res;
}
