#include <cstdio>
#include <iostream>
#define MN 18
#define mod 1000000007

int n, m;
int a[MN], w[MN];
int f[MN][1 << MN];
int fac[1 << MN], inv[1 << MN];

int inc(int a, int b) {return (a += b) >= mod ? a - mod : a;}
int dec(int a, int b) {return (a -= b) < 0 ? a + mod : a;}

int C(int a, int b) {if(a < b) return 0; return 1ll * fac[a] * inv[b] % mod * inv[a - b] % mod;}

int main()
{
	fac[0] = inv[0] = inv[1] = 1;
	for(int i = 1; i <= 65536; i++) fac[i] = 1ll * fac[i - 1] * i % mod;
	for(int i = 2; i <= 65536; i++) inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod;
	for(int i = 1; i <= 65536; i++) inv[i] = 1ll * inv[i - 1] * inv[i] % mod;
	
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= m; i++) scanf("%d", &a[i]);
	w[0] = 1; for(int i = 1; i <= n; i++) w[i] = inc(w[i - 1], w[i - 1]);
	f[m + 1][0] = 1;
	for(int i = m; i >= 1; i--)
	{
		for(int S = 0; S < (1 << n); S++)
		{
			int tot = 0;
			for(int j = 0; j < n; j++)
				if((S >> j) & 1) tot += w[j];
			f[i][S] = f[i + 1][S];
			
			for(int j = 0; j < n; j++)
				if((S >> j) & 1)
					f[i][S] = dec(f[i][S], 1ll * C((w[n] - a[i]) - (tot - w[j]), w[j] - 1) * fac[w[j]] % mod * f[i + 1][S ^ (1 << j)] % mod);
		}
	}
	
	int Ans = 0;
	for(int S = 0; S < (1 << n); S++)
	{
		int tot = w[n] - 1;
		for(int j = 0; j < n; j++)
			if((S >> j) & 1) tot -= w[j];
		
		for(int j = 0; j < n; j++)
			if(!((S >> j) & 1))
			{
				f[1][S] = 1ll * C(tot, w[j]) * fac[w[j]] % mod * f[1][S] % mod;
				tot -= w[j];
			}
		Ans = inc(Ans, f[1][S]);
	}
	
	printf("%lld\n", 1ll * Ans * w[n] % mod);
}