#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7, M = (1 << 22) + 10;
void Solution();
int n, m, ans, inv;
int arr[M];
bool exs[M];
bool marktrans[M];
bool markmask[M];
int32_t main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  Solution();
  return 0;
}
void dfsmask(int v);
void dfstrans(int v) {
  if (marktrans[v]) return;
  marktrans[v] = 1;
  dfsmask(v);
  for (long long int i = 0; i < n; i++) {
    dfstrans(v | (1 << i));
  }
}
void dfsmask(int v) {
  if (!exs[v] || markmask[v]) return;
  markmask[v] = 1;
  dfstrans(v ^ inv);
}
inline void Solution() {
  cin >> n >> m;
  inv = (1 << n) - 1;
  for (long long int i = 0; i < m; i++) {
    cin >> arr[i];
    arr[i] ^= inv;
    exs[arr[i]] = 1;
  }
  for (long long int i = 0; i < m; i++) {
    if (!markmask[arr[i]]) {
      ++ans;
      dfsmask(arr[i]);
    }
  }
  cout << ans << endl;
}
