#include <bits/stdc++.h>
using namespace std;
const int LG = 23;
bool vis[1 << LG];
int n, m, a[1 << LG], ind[1 << LG];
void DFS(int v) {
  vis[v] = true;
  if (v < (1 << n)) {
    int u = ((1 << (n + 1)) - 1) ^ a[v];
    if (!vis[u]) DFS(u);
    return;
  }
  for (int u = 0; u < n; u++)
    if ((v & (1 << u)) && !vis[v ^ (1 << u)]) DFS(v ^ (1 << u));
  if (!vis[ind[v ^ (1 << n)]]) DFS(ind[v ^ (1 << n)]);
}
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> a[i], ind[a[i]] = i;
  int cnt = 0;
  for (int i = 0; i < m; i++)
    if (!vis[i]) DFS(i), cnt++;
  cout << cnt << endl;
  return 0;
}
