#include <iostream>
#include <cstdio>
#include <algorithm>
#define ll long long
using namespace std;
inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
	while(ch >= '0' && ch <= '9') {x = (x << 3) + (x << 1) + (ch ^ 48); ch = getchar();}
	return x * f;
}
const int N = 20,M = (1 << 16) + 1000,mod = 1e9 + 7;
int n,m,S,ans,a[N];
ll jc[M],inv[M],jcinv[M];
ll dp[N][M];
void init(int lim)
{
	jc[0] = jc[1] = inv[0] = inv[1] = jcinv[0] = jcinv[1] = 1;
	for(int i = 2;i <= lim;i ++)
	{
		jc[i] = jc[i - 1] * i % mod;
		inv[i] = inv[mod % i] * (mod - mod / i) % mod;
		jcinv[i] = jcinv[i - 1] * inv[i] % mod;
	}
}
ll C(int x,int y){if(y < 0 || y > x) return 0; return jc[x] * jcinv[y] % mod * jcinv[x - y] % mod;}
signed main()
{
	n = read(); m = read(); for(int i = 1;i <= m;i ++) a[i] = read();
	reverse(a + 1,a + 1 + m);
	init(1 << n); S = (1 << n) - 1; dp[0][0] = 1;
	for(int i = 0;i < m;i ++)
	{
		for(int s = 0; s <= S;s ++)
		{
			int les = S + 1 - a[i + 1] - s;
			dp[i + 1][s] = (dp[i + 1][s] + dp[i][s]) % mod;
			for(int j = 0;j < n;j ++) 
				if(!((s >> j) & 1)) 
					dp[i + 1][s | (1 << j)] = (dp[i + 1][s | (1 << j)] + 1ll * dp[i][s] * C(les,(1 << j) - 1) % mod * jc[1 << j] % mod) % mod;
		}
	}
	for(int i = 0,x,cnt;i <= S;i ++)
	{
		x = i; cnt = 0;
		while(x) x -= x & -x,cnt ++;
		if(cnt & 1) ans = (ans + mod - 1ll * dp[m][i] * jc[S - i] % mod) % mod;
		else ans = (ans + 1ll * dp[m][i] * jc[S - i] % mod) % mod;
	}
	ans = 1ll * ans * (S + 1) % mod;
	cout << ans << "\n"; return 0;
}