#include using namespace std; typedef long long ll; const ll MOD = 998244352; int main() { ll N, K; cin >> N >> K; vector A(N); for (int i = 0; i < N; i++) cin >> A[i]; vector v(N, 0); for (int k = 0; k < K; k++) v[N-1-k] = 1; ll cnt = 0; do { ll s1 = 0, s2 = 0; for (int i = 0; i < N; i++) { if (v[i] == 0) continue; s1 = (s1 + A[i]) % 998; s2 = (s2 + A[i]) % MOD; } if (s2 <= s1) cnt = (cnt + 1) % 998; } while (next_permutation(v.begin(), v.end())); cout << cnt << endl; }