N, K = map(int, input().split()) A = list(map(int, input().split())) itemsum = 0 # 全探索でやったらTLEになった。 def choose_rec(arr, K, N): global itemsum if (len(arr) == K): yield 0 if (len(arr) == 0): s = 1 else: s = arr[-1] + 1 for i in range(s, N+1): arr.append(i) itemsum += A[i-1] yield from choose_rec(arr, K, N) itemsum -= A[i-1] arr.pop() return ans = 0 for order in choose_rec([], K, N): S998 = itemsum % 998 S998244353 = itemsum % 998244353 if (S998244353 <= S998): ans += 1 print(ans % 998)