#include <bits/stdc++.h>
using namespace std;
struct P {
  int x, y;
  bool operator<(const P &a) const { return x > a.x; }
};
vector<int> v;
int a, c, i, b, k, n, d, e, m;
int o[5000100];
int l[5000103];
int j[222];
int dx[10] = {1, 0, -1, 0, 1, 1, -1, -1}, dy[10] = {0, 1, 0, -1, 1, -1, 1, -1},
    dz[10] = {0, 0, 0, 0, 1, -1};
long long x, y, mod = 1000000007;
long long z;
P u[3350];
stack<int> s;
queue<int> q;
string r;
bool as(int a, int b) { return a > b; }
int main() {
  scanf("%d %d", &a, &b);
  m = (1 << a) - 1;
  for (int t = 1; t <= b; t++) {
    scanf("%d", &c);
    o[c] = 1;
  }
  for (int t = 0; t <= m; t++)
    if (o[t] == 1) {
      o[t] = 2;
      k++;
      q.push(t);
      for (; q.size(); q.pop())
        if (!l[q.front()]) {
          l[q.front()] = 1;
          for (int h = 0, i = 1; h < a; h++, i <<= 1)
            if (!(i & q.front())) q.push(i | q.front());
          if (o[q.front() ^ m] == 1) {
            o[q.front() ^ m] = 2;
            q.push(q.front() ^ m);
          }
        }
    }
  printf("%d", k);
}
