#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 4194304;
int dp[N], n, m, maxi;
bool g[N], vis[N];
int r[N], s[N];
vector<int> adj[N];
int get(int i) {
  if (r[i] == i) return i;
  return r[i] = get(r[i]);
}
void link(int a, int b) {
  int i = get(a), j = get(b);
  if (i == j) return;
  if (s[i] > s[j]) swap(i, j);
  r[i] = j;
  s[j] += s[i];
}
int f(int i) {
  if (dp[i] != 0) return dp[i];
  dp[i] = 1;
  int curr = 1;
  for (int j = 0; j < n; curr *= 2, j++) {
    if ((curr & i) != 0) {
      if (f(i - curr) == 2) dp[i] = 2;
    }
  }
  return dp[i];
}
void conn(int x, int y);
void f1(int i) {
  if (g[i]) return;
  g[i] = true;
  int curr = 1;
  for (int j = 0; j < n; curr *= 2, j++) {
    if ((curr & i) != 0) {
      conn(i, i - curr);
    }
  }
}
void conn(int x, int y) {
  if (dp[y] == 1) return;
  link(x, y);
  f1(y);
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  int a[m];
  maxi = pow(2, n) - 1;
  for (int i = 0; i <= maxi; i++) {
    r[i] = i;
    s[i] = 1;
  }
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    dp[a[i]] = 2;
  }
  for (int i = 0; i < pow(2, n); i++) {
    f(i);
  }
  for (int i = 0; i < m; i++) {
    conn(a[i], a[i] ^ maxi);
  }
  int ans = 0;
  for (int i = 0; i < m; i++) {
    if (vis[get(a[i])]) continue;
    ans++;
    vis[get(a[i])] = true;
  }
  cout << ans << endl;
}
