#include <bits/stdc++.h>
using namespace std;

#define all(x) (x).begin(), (x).end()
#define sz(x) static_cast<int>((x).size())

using LL = long long;
template<class T, size_t D>
struct vec : vector<vec<T, D - 1>> {
  template<class... Args>
  vec(size_t n = 0, Args... args)
    : vector<vec<T, D - 1>>(n, vec<T, D - 1>(args...)) {}
};
template<class T>
struct vec<T, 1> : vector<T> {
  template<class... Args>
  vec(Args... args)
    : vector<T>(args...) {}
};

template<class T>
inline bool asMn(T& a, const T& b) { return a > b ? a = b, true : false; }
template<class T>
inline bool asMx(T& a, const T& b) { return a < b ? a = b, true : false; }
inline int nex(int i, int n) { return i == n - 1 ? 0 : i + 1; }
inline int pre(int i, int n) { return !i ? n - 1 : i - 1; }

mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());

template<int MOD>
struct ModInt {
  int a;
  ModInt(int a_ = 0) {
    a = (a_ < MOD ? (a_ < 0 ? a_ + MOD : a_) : a_ - MOD);
  }
  friend ostream& operator<<(ostream& os, const ModInt& o) {
    os << o.a;
    return os;
  }

  bool operator!() const { return !a; }
  explicit operator bool() const { return !!a; }

  ModInt operator-() const { return ModInt() - *this; }
  ModInt operator+(const ModInt& o) const { return ModInt(a + o.a); }
  ModInt operator-(const ModInt& o) const { return ModInt(a - o.a); }
  ModInt operator*(const ModInt& o) const { return ModInt(static_cast<int>(static_cast<LL>(a) * o.a % MOD)); }
  ModInt operator/(const ModInt& o) const { return *this * o.inv(); }
  ModInt& operator+=(const ModInt& o) { return *this = *this + o; }
  ModInt& operator-=(const ModInt& o) { return *this = *this - o; }
  ModInt& operator*=(const ModInt& o) { return *this = *this * o; }
  ModInt& operator/=(const ModInt& o) { return *this = *this / o; }
  ModInt inv() const { return pow(MOD - 2); }
  template<class T>
  ModInt pow(T exp) const {
    ModInt ret(1), c = *this;
    for (; exp; exp >>= 1, c *= c) {
      if (exp & 1) {
        ret *= c;
      }
    }
    return ret;
  }
};
using Mint = ModInt<static_cast<int>(1e9 + 7)>;

int main() {
  ios_base::sync_with_stdio(0); cin.tie(0);

  int n, m; cin >> n >> m;
  vec<int, 1> a(m);
  for (auto& i : a) {
    cin >> i;
  }
  reverse(all(a));

  vec<Mint, 1> fact(1 << n); fact[0] = Mint(1);
  for (int i = 1; i < sz(fact); ++i) {
    fact[i] = fact[i - 1] * Mint(i);
  }
  vec<Mint, 1> invFact(sz(fact)); invFact.back() = fact.back().inv();
  for (int i = sz(invFact) - 2; ~i; --i) {
    invFact[i] = invFact[i + 1] * Mint(i + 1);
  }
  auto binom = [&](int t_n, int t_k) {
    return t_k < 0 || t_n < 0 || t_n < t_k ? Mint() : fact[t_n] * invFact[t_k] * invFact[t_n - t_k];
  };

  vec<Mint, 1> f(1 << n); f[0] = Mint(1);
  for (auto& i : a) {
    for (int mask = (1 << n) - 1; ~mask; --mask) {
      int rem = (1 << n) - i;
      for (int j = 0; j < n; ++j) {
        if (mask >> j & 1) {
          rem -= 1 << j;
        }
      }
      for (int j = 0; j < n; ++j) {
        if (mask >> j & 1) {
          continue ;
        }
        f[mask | (1 << j)] += f[mask] * binom(rem, (1 << j) - 1);
      }
    }
  }

  Mint ans;
  for (int mask = 0; mask < 1 << n; ++mask) {
    int rem = (1 << n) - 1;
    for (int i = 0; i < n; ++i) {
      if (mask >> i & 1) {
        rem -= 1 << i;
      }
    }
    for (int i = 0; i < n; ++i) {
      if (mask >> i & 1) {
        continue ;
      }
      f[mask] *= binom(rem, 1 << i);
      rem -= 1 << i;
    }
    ans += f[mask] * (__builtin_popcount(mask) & 1 ? Mint(-1) : Mint(1));
  }
  ans *= Mint(1 << n);
  for (int i = 0; i < n; ++i) {
    ans *= fact[1 << i];
  }
  cout << ans << '\n';

  return 0;
}

Measured memory_bytes: 4032