#include <bits/stdc++.h>
using namespace std;
int IN() {
  int c, f, x;
  while (!isdigit(c = getchar()) && c != '-')
    ;
  c == '-' ? (f = 1, x = 0) : (f = 0, x = c - '0');
  while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + c - '0';
  return !f ? x : -x;
}
const int N = (1 << 22) + 19;
vector<int> V1[N], V2[N];
int A[N], vis1[N], vis2[N];
int n, m, cnt, res;
void bfs(int s) {
  static int Q[10000000];
  int f = 1, w = 0;
  Q[1] = s;
  vis1[s] = 1;
  while (f > w) {
    int x = Q[++w];
    if (x < n) {
      for (int y : V1[x]) {
        if (!vis2[y]) vis2[y] = 1, Q[++f] = y + n;
      }
    } else {
      x -= n;
      for (int y : V2[x]) {
        if (!vis1[y]) vis1[y] = 1, Q[++f] = y;
      }
      for (int i = 0; i < m; i++)
        if (x >> i & 1) {
          int y = x ^ (1 << i);
          if (!vis2[y]) vis2[y] = 1, Q[++f] = y + n;
        }
    }
  }
}
int main() {
  m = IN(), n = IN();
  for (int i = 0; i < n; i++) A[i] = IN();
  for (int i = 0; i < n; i++) {
    V1[i].push_back(((1 << m) - 1) ^ A[i]);
    V2[A[i]].push_back(i);
  }
  for (int i = 0; i < n; i++)
    if (!vis1[i]) {
      bfs(i);
      res++;
    }
  printf("%d\n", res);
}
