#include using namespace std; using ll = long long; template istream& operator >> (istream& is, vector& vec) { for(T& x : vec) is >> x; return is; } template ostream& operator << (ostream& os, const vector& vec) { if(vec.empty()) return os; os << vec[0]; for(auto it = vec.begin(); ++it != vec.end(); ) os << ' ' << *it; return os; } int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, k, ans = 0;; cin >> n >> k; vector a(n); cin >> a; for(int comb = (1 << k) - 1; comb < (1 << n); ){ ll s = 0; for(int i = 0; i < n; i++){ if(comb >> i & 1) s += a[i]; } ans += (s % 998 >= s % 998244353); int x = comb & (-comb), y = comb + x; comb = ((comb & ~y) / x >> 1) | y; } cout << ans % 998 << '\n'; }