#include "bits/stdc++.h" using namespace std; #define print(x) cout< PI; typedef pair V; typedef vector VE; const ll mod = 1000000007; //10^9+7 int binally_count(int n){ string str(std::bitset<32>(n).to_string, std::allocator >()); int cnt=0; REP(i,32){ if(str[i]=='1')cnt++; } return cnt; } int nPn(int n){ int sum=1; rep(i,1,n+1)sum*=i; return sum; } int main(){ int n,k; cin>>n>>k; ll a[61]; REP(i,n)cin>>a[i]; sort(a,a+k); //printall(k,a); int pre_cnt=0; int ans=1; if(k==0){ ans=nPn(n); print(ans); return 0; } REP(i,k){ int cnt=binally_count(a[i]); if(pre_cnt==cnt||cnt-pre_cnt<0){ print(0); return 0; } ans*=nPn(cnt-pre_cnt); pre_cnt=cnt; } print(ans); }