#include using namespace std; typedef long long ll; typedef vector VI; typedef vector VVI; typedef vector VL; typedef vector VVL; typedef pair PII; #define FOR(i, a, n) for (int i = (int)a; i < (int)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #define MOD 1000000007 #define INF 1000000000 #define PI 3.14159265359 #define EPS 1e-12 ll fact[70]; int main(void) { int n, k; cin >> n >> k; ll a[70]; REP(i, k) cin >> a[i]; //sort(a, a+k); ll before = 0; REP(i, k) { if((a[i] & before) != before) {cout << "0" << endl; return 0;} before = a[i]; } fact[0] = 1; FOR(i, 1, 70) { fact[i] = (fact[i-1] * i) % MOD; //cout << fact[i] << " "; } int count = 0; ll ans = 1; before = 0; REP(i, k) { count = __builtin_popcountll(before ^ a[i]); ans = (ans * fact[count]) % MOD; before = a[i]; //cout << a[i] << " " << ans << " " << count << " " << fact[count] << endl; } count = n - __builtin_popcountll(before); //cout << ans << " " << count << " " << fact[count] << endl; ans = (ans * fact[count]) % MOD; cout << ans << endl; return 0; }