#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vd = vector<double>;
using vb = vector<bool>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
ll mod(ll a, ll b) { return ((a % b) + b) % b; }
int cmp(double x, double y = 0, double tol = 1.e-7) {
  return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1;
}
struct comp {
  vi depth, rep, ord;
  vb present;
  int N;
  comp(vb present) {
    for (N = 0; (1 << N) < present.size(); N++)
      ;
    this->present = move(present);
    compfortcon();
    this->present.clear();
    depth.clear();
    ord.clear();
  }
  void dfs_topsort(int u) {
    for (auto i = 0; i < N; ++i)
      if (u & (1 << i)) {
        int v = u & ~(1 << i);
        if (depth[v] == -1) {
          depth[v] = depth[u] + 1;
          dfs_topsort(v);
        }
      }
    if (present[u]) {
      int v = ((1 << N) - 1) & ~u;
      if (depth[v] == -1) {
        depth[v] = depth[u] + 1;
        dfs_topsort(v);
      }
    }
    ord.push_back(u);
  }
  void dfs_compfortcon(int u, int ent) {
    rep[u] = ent;
    for (auto i = 0; i < N; ++i)
      if ((u & (1 << i)) == 0) {
        int v = u | (1 << i);
        if (rep[v] == -1) dfs_compfortcon(v, ent);
      }
    int v = ((1 << N) - 1) & ~u;
    if (present[v]) {
      if (rep[v] == -1) dfs_compfortcon(v, ent);
    }
  }
  void compfortcon() {
    depth = vi(1 << N, -1);
    ord.clear();
    for (auto u = 0; u < (1 << N); ++u)
      if (depth[u] == -1) {
        depth[u] = 0;
        dfs_topsort(u);
      }
    rep = vi(1 << N, -1);
    for (auto i = ((1 << N)) - 1; i >= 0; --i)
      if (rep[ord[i]] == -1) dfs_compfortcon(ord[i], ord[i]);
  }
};
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  vb present(1 << n, false);
  while (m--) {
    int x;
    scanf("%d", &x);
    present[x] = true;
  }
  comp C(present);
  vi ans;
  for (auto i = 0; i < 1 << n; ++i)
    if (present[i]) ans.push_back(C.rep[i]);
  sort((ans).begin(), (ans).end());
  printf("%d\n", unique((ans).begin(), (ans).end()) - ans.begin());
  return 0;
}
