#include using namespace std; using lint = long long; int ans = 0; int M1 = 998244353; int M2 = 998; int N, K; vectorA(50); int main() { cin >> N >> K; for(int i = 0; i < N; i++) cin >> A[i]; vector perm; for(int i = 0; i < N; i++) { if(i < K) perm.push_back(0); else perm.push_back(1); } do { lint S = 0; for(int i = 0; i < N; i++) { if(perm[i] == 0) S += A[i]; } if(S%M1 <= S%M2) ans++; } while(next_permutation(perm.begin(), perm.end())); cout << ans%M2 << endl; }