#include using namespace std; using ll = long long; #ifdef LOCAL #include #else #define debug(...) #endif int next_conbination(int sub) { assert(sub > 0); int t = sub | (sub - 1); return (t + 1) | (((~t & -~t) - 1) >> (__builtin_ctz(sub) + 1)); } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); int N, K; cin >> N >> K; vector A(N); for (int i = 0; i < N; i++) cin >> A[i]; int ans = 0; for (int bit = (1 << K) - 1; bit < (1 << N); bit = next_conbination(bit)) { ll S998 = 0, S998244353 = 0; for (int i = 0; i < N; i++) { if ((bit >> i) & 1) S998 += A[i], S998244353 += A[i]; } S998 %= 998, S998244353 %= 998244353; if (S998244353 <= S998) ans++; } cout << ans % 998 << '\n'; }