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