Problem:
Score : 1100 points

Problem Statement

There are 2^N players, numbered 1, 2, ..., 2^N.
They decided to hold a tournament.

The tournament proceeds as follows:

Choose a permutation of 1, 2, ..., 2^N: p_1, p_2, ..., p_{2^N}.

The players stand in a row in the order of Player p_1, Player p_2, ..., Player p_{2^N}.

Repeat the following until there is only one player remaining in the row:

Play the following matches: the first player in the row versus the second player in the row, the third player versus the fourth player, and so on. The players who lose leave the row. The players who win stand in a row again, preserving the relative order of the players.

The last player who remains in the row is the champion.

It is known that, the result of the match between two players can be written as follows, using M integers A_1, A_2, ..., A_M given as input:

When y = A_i for some i, the winner of the match between Player 1 and Player y (2 \leq y \leq 2^N) will be Player y.

When y \neq A_i for every i, the winner of the match between Player 1 and Player y (2 \leq y \leq 2^N) will be Player 1.

When 2 \leq x < y \leq 2^N, the winner of the match between Player x and Player y will be Player x.

The champion of this tournament depends only on the permutation p_1, p_2, ..., p_{2^N} chosen at the beginning.
Find the number of permutation p_1, p_2, ..., p_{2^N} chosen at the beginning of the tournament that would result in Player 1 becoming the champion, modulo 10^9 + 7.

Constraints

1 \leq N \leq 16

0 \leq M \leq 16

2 \leq A_i \leq 2^N (1 \leq i \leq M)

A_i < A_{i + 1} (1 \leq i < M)

Input

Input is given from Standard Input in the following format:

N M
A_1 A_2 ... A_M

Output

Print the answer.

Sample Input 1

2 1
3

Sample Output 1

8

Examples of p that satisfy the condition are: [1, 4, 2, 3] and [3, 2, 1, 4]. Examples of p that do not satisfy the condition are: [1, 2, 3, 4] and [1, 3, 2, 4].

Sample Input 2

4 3
2 4 6

Sample Output 2

0

Sample Input 3

3 0

Sample Output 3

40320

Sample Input 4

3 3
3 4 7

Sample Output 4

2688

Sample Input 5

16 16
5489 5490 5491 5492 5493 5494 5495 5497 18993 18995 18997 18999 19000 19001 19002 19003

Sample Output 5

816646464

Solution in C++14 (GCC 5.4.1) (judge verdict: Runtime Error)

#include<stdio.h>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
typedef pair<int,int> pii;
typedef long long int lld;
const lld MAX=17;
const lld MOD=1000000007;
lld dp[1<<MAX][MAX+3],n,m,a[MAX+3],p[1<<MAX]={1,1,},mdp[1<<MAX],fin,pow2[1<<MAX][MAX+3];
lld pow(lld x,lld y){
    if(y==0) return 1;
    if(y==1) return x;
    lld t=pow(x,y/2);
    if(y%2) return (((t*t)%MOD)*x)%MOD;
    return (t*t)%MOD;
}
lld comb(lld x,lld y){
    if(x<0||y<0||y>x) return 0;
    return ((p[x]*pow(p[y],MOD-2)%MOD)*pow(p[x-y],MOD-2))%MOD;
}
lld make_dp(lld x,lld y){
    if(y==0){
        if(x==0) return 1;
        return 0;
    }
    if(dp[x][y]==-1){
        dp[x][y]=0;
        for(lld i=0;i<n;i++) if(x&(1<<i)){
            dp[x][y]+=(pow2[(1<<n)-a[y-1]-(x-(1<<i))][i]*make_dp(x-(1<<i),y-1))%MOD;
            dp[x][y]%=MOD;
        }
        dp[x][y]+=make_dp(x,y-1),dp[x][y]%=MOD;
        //printf("%lld %lld %lld\n",x,y,dp[x][y]);
    }
    return dp[x][y];
}
int main(){
    scanf("%lld%lld",&n,&m);
    for(lld i=1;i<(1<<n)+5;i++) p[i+1]=p[i]*(i+1),p[i+1]%=MOD;
    for(lld i=0;i<(1<<n)+5;i++) for(lld j=0;j<=m+1;j++) dp[i][j]=-1,pow2[i][j]=comb(i,(1<<j)-1);
    for(lld i=m-1;i>=0;i--) scanf("%lld",&a[i]);
    for(lld i=0;i<(1<<n);i++) {
        mdp[i]=make_dp(i,m);
        lld r=0;
        for(lld j=0,cnt=i;j<n;j++) if((i&(1<<j))==0) r++,mdp[i]*=comb((1<<n)-cnt-1,(1<<j)),mdp[i]%=MOD,cnt+=(1<<j);
        if((n-r)%2==1) fin+=MOD-mdp[i],fin%=MOD;
        else fin+=mdp[i],fin%=MOD;
        //printf("%lld %lld\n",n-r,mdp[i]);
    }
    for(lld i=0;i<n;i++) fin*=p[1<<i],fin%=MOD;
    fin*=(1<<n),fin%=MOD;
    printf("%lld\n",fin);
}