N, k = map(int, input().split()) B = [0]*N ans = 1 mod = 10**9+7 if k: A = [int(i) for i in input().split()] if 0 not in A: A.append(0) if 2**N-1 not in A: A.append(2**N-1) A.sort() A = [bin(a)[:1:-1] for a in A] for a in A: n = 0 for i, l in enumerate(a): if l == "1" and not B[i]: n += 1 ans *= n ans %= mod B[i] = 1 elif l == "0" and B[i]: print(0) exit() print(ans) else: for i in range(N): ans *= i+1 ans %= mod print(ans)