#include #include #include #include #include #include #include #include using namespace std; typedef long long int ll; typedef pair Pii; const ll mod_small = 998; const ll mod_large = 998244353; ll solve(vector &idx, int next_begin, int sum_small, int sum_large, const int n, const int k, const vector &a) { if ((int) idx.size() == k) { if (sum_large <= sum_small) return 1; else return 0; } ll ans = 0; for (int i = next_begin; i < n; i++) { idx.push_back(i); ans += solve(idx, i + 1, (sum_small + a[i]) % mod_small, (sum_large + a[i]) % mod_large, n, k, a); idx.pop_back(); } return ans; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n, k; cin >> n >> k; vector a(n); for (auto &x: a) cin >> x; vector idx; ll ans = solve(idx, 0, 0, 0, n, k, a); cout << ans % mod_small << endl; return 0; }