#include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define int long long #define double long double typedef vector VI; typedef pair pii; typedef vector VP; typedef vector VS; typedef priority_queue PQ; templatebool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } templatebool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } #define fore(i,a) for(auto &i:a) #define REP(i,n) for(int i=0;i, greater > q2; int dp[11][1 << 10]; ll modpow(ll a, ll n = mod - 2) { ll r = 1; while (n) r = r * ((n % 2) ? a : 1) % mod, a = a * a%mod, n >>= 1; return r; } long long modinv(long long a) { return modpow(a, mod - 2); } signed main() { cin.tie(0); ios::sync_with_stdio(false); int N, K; cin >> N >> K; VI A(N); mapmp; REP(i, N) { cin >> A[i]; mp[A[i]]++; } if (10 < K) { cout << 0 << endl; return 0; } dp[0][0] = 1; REP(i, K) { REP(j, 1 << 10) { REP(k, 1 << 10) { if (j&k)continue; dp[i + 1][j | k] += dp[i][j] * mp[k]; } } } int ans = 0; REP(i, 1 << 10) { ans += dp[K][i]; ans %= mod; } REP(i, K) { ans *= modinv(i + 1); ans %= mod; } cout << ans << endl; return 0; }