#include using namespace std; using ll = long long; using P = pair; using T = tuple; // #include // using namespace atcoder; // using mint = modint1000000007; #define rep(i, n) for(ll i = 0; i < n; i++) int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); ll n, k; cin >> n >> k; ll mod = 998; vector a(n); rep(i,n) cin >> a[i]; vector p; rep(i,k) p.emplace_back(1); while( p.size() < n ) p.emplace_back(0); sort(p.begin(), p.end()); ll ans = 0; do { ll sum = 0; rep(i,n) if( p[i] ) sum += a[i]; if( sum%998 >= sum%998244353 ) ans++; } while(next_permutation(p.begin(), p.end())); cout << ans%998 << endl; return 0; }