#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)s; i < (int)e; i++) int main() { cin.tie(nullptr); int N, K; cin >> N >> K; vector A(N); rep(i, 0, N) cin >> A[i]; vector bit(N, false); rep(i, N - K, N) bit[i] = true; int ans = 0; do { ll sum = 0; rep(i, 0, N) if (bit[i]) sum += A[i]; ll mod1 = sum % 998244353ll; ll mod2 = sum % 998; if (mod1 <= mod2) ans++; } while (next_permutation(bit.begin(), bit.end())); cout << ans % 998 << '\n'; }