N,K=map(int,input().split()) A=list(map(int,input().split())) from itertools import combinations ans=0 for i in combinations(list(range(N)),K): now=0 for j in i: now+=A[j] if now%998244353<=now%998: ans+=1 print(ans%998)