#include using namespace std; void fast_io() { ios::sync_with_stdio(false); std::cin.tie(nullptr); } int main() { fast_io(); int n, k; cin >> n >> k; vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } vector cmb(n); for (int i = 0; i < k; i++) { cmb[i] = 1; } sort(cmb.begin(), cmb.end()); int ans = 0; do { int sum_998244 = 0, sum_998 = 0; for (int i = 0; i < n; i++) { if (cmb[i] == 1) { sum_998244 = (sum_998244 + a[i]) % 998244353; sum_998 = (sum_998 + a[i]) % 998; } } if (sum_998244 <= sum_998) { ans++; ans %= 998; } } while (next_permutation(cmb.begin(), cmb.end())); cout << ans << endl; }