#include // cout, endl, cin #include // string, to_string, stoi #include // vector #include // min, max, swap, sort, reverse, lower_bound, upper_bound #include // pair, make_pair #include // tuple, make_tuple #include // int64_t, int*_t #include // printf #include // map #include // queue, priority_queue #include // set #include // stack #include // deque #include // unordered_map #include // unordered_set #include // bitset #include // isupper, islower, isdigit, toupper, tolower #include #include #include #include #include #include #include #include #include //#include //using namespace atcoder; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define repl(i,l,r) for (int i = l; i < (int)(r); i++) #define all(a) a.begin(),a.end() #define Pii pair #define Pll pair #define INFi 1000000001 #define INFl 1000000000000000001 #define ll long long using namespace std; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template void printArray(vector&A){ for(T&a:A){ cout< void printArrayln(vector&A){ for(T&a:A){ cout< std::ostream &operator<<(std::ostream &out, const pair &A){ cout<<"{"< std::ostream &operator<<(std::ostream &out, const map &M){ for(const auto&A:M){ cout<<"{"< std::ostream &operator<<(std::ostream &out, const set &M){ cout<<"{"; for(const auto&A:M){ cout< std::ostream &operator<<(std::ostream &out, const multiset &M){ cout<<"{"; for(const auto&A:M){ cout< std::ostream &operator<<(std::ostream &out, const vector &A){ for(const T &a:A){ cout< void print(Head H, Tail... T) { cout << H << " "; print(T...); } template std::istream &operator>>(std::istream &in,vector&A){ for(T&a:A){ std::cin>>a; } return in; } vector> permutations(int N){ vector array(N); vector> A(0); for(int i=0;i> permutation(int N,int U,bool h=false){ //0,1,2,3,...,N-1縺ョN蛟九°繧蔚蛟矩∈縺カ鬆・・ vector> A(0); auto fun = [&h,&A,&N,&U](auto &fun,vector &B)->void{ if((int)B.size()==U){ auto C=B; do{ A.push_back(C); }while(next_permutation(C.begin(),C.end())); return; } int s = (h?0:-1); if(!B.empty())s = B.back(); for(int x=s+(h?0:1);x C={}; fun(fun,C); return A; } vector> combination(int N,int U,bool h=false){ //0,1,2,3,...,N-1縺ョN蛟九°繧蔚蛟矩∈縺カ邨・∩蜷医o縺幃・・ vector> A(0); auto fun = [&h,&A,&N,&U](auto &fun,vector &B)->void{ if((int)B.size()==U){ auto C=B; A.push_back(B); return; } int s = (h?0:-1); if(!B.empty())s = B.back(); for(int x=s+(h?0:1);x C={}; fun(fun,C); return A; } int main(void){ std::cin.tie(0)->sync_with_stdio(0); long N,K;cin>>N>>K; vector A(N); rep(i,N)cin>>A[i]; int cnt = 0; auto B = combination(N,K,false); for(auto&C:B){ long sum = 0; for(auto&c:C){ sum += A[c]; } if(sum%998244353<=sum%998)cnt++; } cout<