#int(input()) #map(int, input().split()) #list(map(int, input().split())) N, k = map(int, input().split()) a = [] if k != 0: a = list(map(int, input().split())) mod = 10 ** 9 + 7 m = 100 fac = [1] * (m + 1) for i in range(1, m+1): fac[i] = (fac[i-1] * i) % mod a = sorted(a) if 0 not in a: a = [0] + a if 2**N - 1 not in a: a.append(2**N-1) f = 1 for i in range(len(a)-1): u = a[i] ^ a[i+1] if u + a[i] != a[i+1]: f = 0 break if f == 0: print(0) exit() def popcount(a): b = format(a, "b") return b.count("1") ans = 1 for i in range(len(a)-1): d = popcount(a[i+1]) - popcount(a[i]) ans = (ans * fac[d]) % mod print(ans)