#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 inf= 1e18; int a[65]; set s; int main(){ int N,k; cin>>N>>k; REP(i,0,k) cin>>a[i]; REP(i,0,k){ int n=__builtin_popcount(a[i]); if(s.find(n)!=s.end()){ p(0); return 0; } s.insert(n); } ll ans=1; REP(i,2,N-k+1){ ans*=i; } p(ans); return 0; }