// https://atcoder.jp/contests/arc093/tasks/arc093_d
//
#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, [ next / $t:tt ]) => {
        {
            let len = read_value!($iter, usize);
            (0..len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
        }
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! dvec {
    ($t:expr ; $len:expr) => {
        vec![$t; $len]
    };

    ($t:expr ; $len:expr, $($rest:expr),*) => {
        vec![dvec!($t; $($rest),*); $len]
    };
}

#[allow(unused_macros)]
macro_rules! ifv {
    ($t:expr, $a:expr, $b: expr) => {
        if $t { $a } else { $b }
    }
}

#[allow(unused_macros)]
macro_rules! fill {
    ($t:expr, $v:expr) => {
        for i in 0..$t.len() {
            $t[i] = $v;
        }
    };
}

#[allow(unused_macros)]
macro_rules! join {
    ($t:expr, $glue:expr) => {
        $t.into_iter().map(|w| w.to_string()).collect::<Vec<_>>().join($glue)
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

const MOD: i64 = 1e9 as i64 + 7;

struct Combination {
    fact: Vec<i64>,
    invfact: Vec<i64>,
}

impl Combination {
    fn inv(a: i64) -> i64 {
        Combination::pow(a, MOD - 2)
    }

    fn pow(a: i64, p: i64) -> i64 {
        let mut p = p;
        let mut aa = a;
        let mut ret = 1;
        while p >= 1 {
            if p & 1 == 1 {
                ret *= aa;
                ret %= MOD;
            }
            p >>= 1;
            aa = aa * aa % MOD;
        }
        ret
    }

    fn new(upto: usize) -> Self {
        let mut fact = vec![0; upto];
        let mut invfact = vec![0; upto];

        fact[0] = 1;
        for i in 1..upto {
            fact[i] = fact[i - 1] * (i as i64) % MOD;
        }

        invfact[upto - 1] = Combination::inv(fact[upto - 1]);
        invfact[0] = 1;
        for i in (1..upto - 1).rev() {
            invfact[i] = invfact[i + 1] * ((i + 1) as i64) % MOD;
        }

        Combination {
            fact: fact,
            invfact: invfact,
        }
    }

    fn comb(&self, n: usize, r: usize) -> i64 {
        if r < 0 || r > n {
            return 0;
        }
        self.fact[n] * self.invfact[r] % MOD * self.invfact[n - r] % MOD
    }
}

fn main() {
    input! {
        n: usize, m: usize,
        a: [usize; m]
    };

    let mut ng = 0;
    let c = 1<<n;
    let mut comb = Combination::new(c+10);
    let mut a = a;
    a.reverse();


    let mut dp = dvec!(0; m+1, c);
    dp[0][0] = 1;
    for i in 0..m {
        for p in 0..c {
            let base = dp[i][p];
            if base == 0 {
                continue;
            }
            let left = c - a[i] - p;

            dp[i+1][p] += base;
            dp[i+1][p] %= MOD;

            for u in 0..n {
                if p & (1<<u) != 0 {
                    continue;
                }
                let tp = p | 1<<u;
                if left < (1<<u)-1 {
                    continue;
                }
                let add = base * comb.comb(left, (1<<u)-1) % MOD * comb.fact[1<<u] % MOD;
                dp[i+1][tp] += add;
                dp[i+1][tp] %= MOD;
            }
        }
    }

    let mut ans = 0;
    for p in 0..c {
        let left = c - p - 1;
        let add = dp[m][p] * comb.fact[left] % MOD * (c as i64) % MOD;
        if p.count_ones() % 2 == 0 {
            ans += add;
        } else {
            ans += MOD-add;
        }
        ans %= MOD;
    }

    println!("{}", ans);
}


Measured memory_bytes: 16636