Good Set

주어진 n개의 수를 모두 포함하면서 비트 AND와 OR에 닫혀 있는 {0,...,2^k-1}의 부분집합 개수를 센다.

어려움8비트 연산조합론완전 탐색수학아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Seunghyun is a mathematician, and he likes good jokes. 

For a set U=0,1,,2k1U = \\{0, 1, \cdots, 2^k - 1\\}, a nonempty subset AUA \subset U is good if it satisfies the following rules. 

  • For any x,ySx, y \in S, their bitwise-and x&yx \And y should be in SS
  • For any x,ySx, y \in S, their bitwise-or xyx \mid y should be in SS

You are given nn distinct integers in \[0,2k1]\[0, 2^k-1] range. Find the number of good sets which contains all nn integers.

입력

The first line contains two integers k,nk, n. (1k7,0n2k1 \le k \le 7, 0 \le n \le 2^k)

The next line contains nn distinct integers a_1,a_2,,a_na\_1, a\_2, \cdots, a\_n(0a_i2k10 \le a\_i \le 2^k - 1).

출력

Print a single integer denoting the number of good sets.