#include <bits/stdc++.h>
using namespace std;
const int zzy = 1000000007;
int a[20], n, m, fac[65540], facinv[65540];
int dp[18][65536];
inline int P(int a, int b) {
    if (b < 0 || b > a) return 0;
    return 1ll * fac[a] * facinv[a - b] % zzy;
}
inline int count(int x) {
    int ans = 0;
    for (; x; x ^= x & -x) ans++;
    return ans;
}
int main() {
    cin >> n >> m;
    // if (m > n) return puts("0"), 0;
    for (int i = 1; i <= m; i++) cin >> a[i];
    fac[0] = fac[1] = facinv[0] = facinv[1] = 1;
    for (int i = 2; i <= 1 << n; i++) fac[i] = i, facinv[i] = 1ll * (zzy - zzy / i) * facinv[zzy % i] % zzy;
    for (int i = 1; i <= 1 << n; i++) fac[i] = 1ll * fac[i] * fac[i - 1] % zzy, facinv[i] = 1ll * facinv[i] * facinv[i - 1] % zzy;
    reverse(a + 1, a + 1 + m);
    dp[0][0] = 1;
    for (int i = 1; i <= m; i++) {
        for (int j = 0; j < 1 << n; j++) {
            // if (j + a[i] - 1 > 1 << n) continue;
            dp[i][j] = dp[i - 1][j];
            for (int k = 1; k < 1 << n; k <<= 1) {
                if (!(j & k)) continue;
                dp[i][j] = (dp[i][j] - 1ll * dp[i - 1][j ^ k] * P((1 << n) - a[i] - (j ^ k), k - 1) % zzy * k % zzy + zzy) % zzy;
            }
        }
    }
    int ans = 0;
    for (int i = 0; i < 1 << n; i++) {
        int now = 1ll * dp[m][i] * P((1 << n) - i - 1, (1 << n) - i - 1) % zzy;
        ans = (ans + now) % zzy;
    }
    return cout << 1ll * (1 << n) * ans % zzy << endl, 0;
}
/*
1 2 3 4 F
1 2 4 3 F
1 3 2 4 F
1 3 4 2 F
1 4 2 3 T
1 4 3 2 T
*/