#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>

namespace IO {
    template <typename _T>
    inline bool read (_T& x) {
        x = 0;
        _T y = 1;
        char c = getchar();
        while ((c < '0' || '9' < c) && c != EOF) {
            if (c == '-') y = -1;
            c = getchar();
        }
        if (c == EOF) return false;
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getchar();
        x *= y;
        return true;
    }

    template <typename _T>
    inline _T input () {
        _T x = 0, y = 1;
        char c = getchar();
        while ((c < '0' || '9' < c) && c != EOF) {
            if (c == '-') y = -1;
            c = getchar();
        }
        if (c == EOF) return 0;
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getchar();
        x *= y;
        return x;
    }
};
using namespace IO;

#define reg register
#define MAX_N 17
#define MOD 1000000007
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define rep(i, l, r) for(int i = l; i <= r; ++i)
#define lep(i, l, r) for(int i = l; i < r; ++i)
#define irep(i, r, l) for(int i = r; i >= l; --i)
#define ilep(i, r, l) for(int i = r; i > l; --i)
typedef long long ll;

int N, M, T;
int a[MAX_N + 7], f[MAX_N + 7][(1 << MAX_N) + 7], pw[MAX_N + 7];
int fac[(1 << MAX_N) + 7], ifac[(1 << MAX_N) + 7];

inline int add (int x, int y) { return (x += y) >= MOD ? x - MOD : x; }

inline void cadd (int& x, int y) { (x += y) >= MOD ? x -= MOD : 0; }

inline int mul (int x, int y) { return 1LL * x * y % MOD; }

inline int qpow (int x, int y) {
    int ans = 1;
    for (; y; y >>= 1, x = mul(x, x)) if (y & 1) ans = mul(ans, x);
    return ans;
}

inline int C (int x, int y) {
    if (x < y || y < 0) return 0;
    return mul(fac[x], mul(ifac[y], ifac[x - y]));
}

int main () {
#ifdef LOCAL
    freopen ("in", "r", stdin);
#endif
    read(N), read(M);
    pw[0] = 1;
    rep (i, 1, N) pw[i] = mul(pw[i - 1], 2);
    T = 1 << N;
    fac[0] = ifac[0] = 1;
    rep (i, 1, T) fac[i] = mul(fac[i - 1], i);
    ifac[T] = qpow(fac[T], MOD - 2);
    irep (i, T - 1, 1) ifac[i] = mul(ifac[i + 1], i + 1);
    rep (i, 1, M) read(a[i]);
    f[M + 1][0] = 1;
    irep (i, M, 1) {
        lep (s, 0, pw[N]) {
            cadd(f[i][s], f[i + 1][s]);
            int lft = pw[N] - a[i];
            rep (j, 1, N) if (s & pw[j - 1]) lft -= pw[j - 1];
            // printf("%d %d\n", s, lft);
            if (lft < 0) continue;
            rep (j, 1, N) if (f[i + 1][s] && !(s & pw[j - 1])) {
                int ns = s | pw[j - 1];
                // printf("%d %d %d %d %d\n", i, s, ns,
                //        pw[j - 1] - 1, C(lft, pw[j - 1] - 1));
                cadd(f[i][ns], mul(f[i + 1][s],
                                   mul(C(lft, pw[j - 1] - 1),
                                       fac[pw[j - 1]])));
            }
        }
    }
    int res = 0;
    lep (s, 0, pw[N]) {
        int cnt = 0, tot = 0;
        rep (i, 1, N) if (s & pw[i - 1]) cnt++, tot += pw[i - 1];
        // printf("%d %d %d %d\n", s, f[1][s], cnt, tot);
        int ans = mul(f[1][s], fac[pw[N] - tot - 1]);
        cadd(res, (cnt & 1) ? MOD - ans : ans);
    }
    printf("%d\n", mul(res, pw[N]));
    return 0;
}


Measured memory_bytes: 9216