#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int dx[4]={1,0,-1,0} , dy[4]={0,1,0,-1} ;
ll fact[101010],invfact[101010],inv[101010];
ll comb(int n,int k){
    if(n<0||k<0||k>n)return 0;
    ll ret=invfact[k]*invfact[n-k]%mod;
    return ret*fact[n]%mod;
}
int main(){
    inv[1]=1;
    REP(i,2,100001)inv[i]=mod-inv[mod%i]*(mod/i)%mod;
    fact[0]=invfact[0]=1;
    rep(i,100000){
        fact[i+1]=fact[i]*(i+1)%mod;
        invfact[i+1]=invfact[i]*inv[i+1]%mod;
    }
    int n,m;
    cin>>n>>m;
    int a[m];
    rep(i,m)cin>>a[m-1-i];
    int all=1<<n;
    ll dp[all];
    int sum[all];
    rep(i,all)sum[i]=i;
    rep(i,all)dp[i]=0;
    dp[0]=all;
    rep(i,m)for(int bit=all-1;bit>=0;bit--)rep(j,n){
        if(bit&(1<<j))continue;
        int cnt=(1<<j);
        cnt--;
        ll res=comb(all-sum[bit]-a[i],cnt)*fact[cnt+1]%mod;
        dp[bit|(1<<j)]+=res*dp[bit];
        dp[bit|(1<<j)]%=mod;
    }
    rep(i,all)dp[i]=dp[i]*fact[all-sum[i]-1]%mod;
    ll ans=0;
    rep(i,all){
        int cnt=__builtin_popcount(i);
        if(cnt%2)ans+=mod-dp[i];
        else ans+=dp[i];
        ans%=mod;
    }
    cout<<ans<<endl;
   return 0;
}