#include //#include using namespace std; //using namespace atcoder; using ll = long long; //const ll mod = 1000000007; const int mod = 998244353; ll n, k, a[39]; int main() { cin >> n >> k; for (int i = 1; i <= n; i++)cin >> a[i]; vectorv; for (int i = 1; i <= k; i++)v.push_back(1); for (int i = k + 1; i <= n; i++)v.push_back(0); sort(v.begin(), v.end()); ll ans = 0; do { ll sum = 0; for (int i = 0; i < v.size(); i++) { if (v[i] == 1)sum += a[i + 1]; } if (sum % mod <= sum % 998LL)ans++; } while (next_permutation(v.begin(), v.end())); cout << ans%998LL << endl; }