#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
inline char nextChar() {
  static char buf[1 << 16];
  static int pos = 1;
  static int capacity = 1;
  if (pos == capacity) {
    if (capacity == 0) return 0;
    capacity = (int)fread(buf, 1, 1 << 16, stdin);
    pos = 0;
  }
  return buf[pos++];
}
template <class T>
T nextInt() {
  char c = nextChar();
  while (isspace(c)) c = nextChar();
  T res = 0;
  while (isdigit(c)) {
    res = res * 10 + c - '0';
    c = nextChar();
  }
  return res;
}
int n, m, full;
char p[1 << 22];
char c[1 << 22];
void DFS1(int x);
void DFS(int x);
void DFS1(int x) {
  c[x] |= 2;
  if (p[x ^ full] && (c[x ^ full] & 1) == 0) DFS(x ^ full);
  for (int e = x ^ full; e != 0;) {
    int t = (e ^ (e - 1)) & ~(e - 1);
    if ((c[x ^ t] & 2) == 0) DFS1(x ^ t);
    e ^= t;
  }
}
void DFS(int x) {
  c[x] |= 1;
  if ((c[x] & 2) == 0) DFS1(x);
}
int main() {
  n = nextInt<int>();
  m = nextInt<int>();
  full = (1 << n) - 1;
  for (int i = 0; i < m; i++) p[nextInt<int>()] = 1;
  int u = 0;
  for (int i = 0; i < (1 << n); i++) {
    if (p[i] && (c[i] & 1) == 0) {
      DFS(i);
      ++u;
    }
  }
  cout << u << endl;
  return 0;
}
