#include #ifdef LOCAL #include "utility/debug.hpp" #else #define debug(...) #endif using namespace std; namespace rv = std::views; // NOLINT // clang-format off using lint = long long; using P = pair; #define ALL(a) (a).begin(), (a).end() template inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } inline void Yes(bool b = true) { println("{}",(b ? "Yes" : "No")); } inline void No() { println("{}", "No");} // clang-format on /**/ int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int N, K; cin >> N >> K; vector A(N); for (auto&& a : A) cin >> a; int ans = 0; const lint MOD1 = 998; const lint MOD2 = 998244353; auto dfs = [&](this auto&& self, int depth, int last, lint sum) -> void { if (depth == K) { if (sum % MOD1 >= sum % MOD2) { ans++; if (ans >= 998) ans -= 998; } return; } for (int i = last + 1; i < N; i++) { self(depth + 1, i, sum + A[i]); } }; dfs(0, -1, 0); println("{}", ans); }