#include "bits/stdc++.h" #define REP(i,n,N) for(ll i=(n); i<(N); i++) #define RREP(i,n,N) for(ll i=(N-1); i>=n; i--) #define CK(n,a,b) ((a)<=(n)&&(n)<(b)) #define ALL(v) (v).begin(),(v).end() #define p(s) cout<<(s)<> typedef long long ll; using namespace std; const ll mod= 1e9+7; ll a[65]; ll f[65]; int main(){ ll N,k; cin>>N>>k; f[0]=f[1]=1; REP(i,2,N+1){ f[i]=f[i-1]*i; f[i]%=mod; } REP(i,0,k) { cin>>a[i]; } sort(a,a+k); ll ans=f[__builtin_popcountll(a[0])]; REP(i,0,k-1){ if((a[i+1]^a[i])!=(a[i+1]-a[i])){ p(0); return 0; } ans*=f[__builtin_popcountll(a[i+1]^a[i])]; ans%=mod; } ans*=f[N-__builtin_popcountll(a[k-1])]; p(ans%mod); return 0; }