# 非再帰BFS (K個目をqに入れて取り出した時に判定) from collections import deque N,K = map(int,input().split()) assert 1 <= N <= 28 assert 1 <= K <= min(8,N) A = list(map(int,input().split())) for a in A: assert 0 <= a <= 998244352 ans = 0 # [i,l,s]: i個選んだ,今まで選んだ数字のうち一番後ろのindexはl,和はs q = deque([[0,-1,0]]) while q: i,l,s = q.popleft() if i == K: if s % 998244353 <= s % 998: ans += 1 continue for j in range(l+1,N-K+1+i): q.append([i+1,j,s+A[j]]) print(ans % 998)