#include #if __has_include() #include using namespace atcoder; #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using mint = modint998244353; struct modfact { int n; vector d; modfact(): n(2), d({1,1}) {} mint operator()(int i) { while (n <= i) d.push_back(d.back()*n), ++n; return d[i]; } mint operator[](int i) const { return d[i];} } facts; int main() { int n, k; cin >> n >> k; vector a(n); rep(i, n) cin >> a[i]; if (k > 10) { puts("0"); return 0; } unordered_map cnt; rep(i, n) cnt[a[i]]++; int m = 10, m2 = 1<(m2)); dp[0][0] = 1; rep(i, k)rep(s, m2)rep(t, m2) { if (!(s&t)) dp[i+1][s|t] += dp[i][s]*cnt[t]; } mint ans; rep(s, m2) ans += dp[k][s]; ans /= facts(k); cout << ans.val() << '\n'; return 0; }