#include <bits/stdc++.h>
using namespace std;
int a[(1 << 22) + 10];
bool exists[(1 << 22) + 10];
int n, m;
bool vis[2][(1 << 22) + 10];
void dfs(int state, int node) {
  vis[state][node] = 1;
  if (state == 0) {
    if (!vis[1][node]) dfs(1, node);
    return;
  }
  int inverse = 0;
  for (int bit = 0; bit < n; bit++) {
    if (!((1 << bit) & node)) {
      inverse += (1 << bit);
      if (!vis[1][node | (1 << bit)]) dfs(1, node | (1 << bit));
    }
  }
  if (!vis[0][inverse] && exists[inverse]) {
    dfs(0, inverse);
  }
}
int ans;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    exists[a[i]] = 1;
  }
  for (int i = 0; i < m; i++) {
    if (vis[0][a[i]]) continue;
    ans++;
    dfs(0, a[i]);
  }
  cout << ans;
}
