N, K = map(int, input().split()) A = list(map(int, input().split())) ans = 0 lst = [-1] def dfs(lst): global ans if len(lst) == K + 1: # print(lst[1:]) S = 0 for x in lst[1:]: S += A[x] if S % 998244353 <= S % 998: ans += 1 else: for i in range(lst[-1] + 1, N): lst.append(i) dfs(lst) lst.pop() dfs(lst) print(ans % 998)