import itertools n,k=map(int,input().split()) a=list(map(int,input().split())) ans=0 for p in itertools.combinations(range(n),k): t=0 for i in p:t+=a[i] if t%998244353<=t%998: ans+=1 print(ans%998)