#include <bits/stdc++.h>
using namespace std;
const int N = 5e6 + 15;
const double EPS = 1e-9;
int n, m, a[N], pre[N];
bool in[N], _out[N], _[N];
int finfa(int a) { return a == pre[a] ? a : pre[a] = finfa(pre[a]); }
bool dfs(int u, int v) {
  int p1 = finfa(u), p2 = finfa(v);
  if (_[p2] && _[p1] && p1 != p2) pre[p1] = p2;
  if (in[v]) return 0;
  in[v] = 1;
  if (_[v]) dfs(u, ((1 << n) - 1) ^ v);
  for (int i = (0); i < (n); ++i) {
    (1 & (v >> i)) && (dfs(u, v ^ (1 << i)));
  }
  return 0;
}
int main() {
  cin >> n >> m;
  for (int i = (0); i < ((1 << 22) + 7); ++i) pre[i] = i;
  for (int i = (1); i < (m + 1); ++i) {
    scanf("%d", &a[i]);
    _[a[i]] = 1;
  }
  for (int i = (1); i < (m + 1); ++i) {
    if (finfa(a[i]) != a[i]) continue;
    dfs(a[i], ((1 << n) - 1) ^ a[i]);
  }
  int ans = 0;
  for (int i = (1); i < (m + 1); ++i) {
    ans += _out[finfa(a[i])] == 0;
    _out[finfa(a[i])] = 1;
  }
  cout << ans << endl;
}
