#!/usr/bin/env pypy3 # Ref: #138103 import math P = 10 ** 9 + 7 def bits(n): return {i for i, b in enumerate(reversed("{:b}".format(n))) if b == '1'} def solve(n, xs, mod=P): if not xs: return math.factorial(n) % mod ys = sorted(xs) ans = 1 for y_i, y_j in zip([0] + ys, ys + [2 ** n - 1]): bs_i = bits(y_i) bs_j = bits(y_j) if bs_i <= bs_j: ans = ans * math.factorial(len(bs_j) - len(bs_i)) & mod else: return 0 return ans def main(): n, k = (int(x) for x in input().split()) if k == 0: xs = [] else: xs = [int(x) for x in input().split()] print(solve(n, xs)) if __name__ == '__main__': main()