N, K = map(int, input().split()) A = list(map(int, input().split())) M1 = 998244353 M2 = 998 ans = 0 def f(B, idx): global ans if(len(B) == K): S = sum(B) if (S%M1) <= (S%M2): ans = (ans + 1) % M2 return for i in range(idx, N): B.append(A[i]) f(B, i+1) B.pop() f([], 0) print(ans)