import pypyjit pypyjit.set_param('max_unroll_recursion=-1') # pypyの再帰高速化 N,K = map(int,input().split()) assert 1 <= N <= 35 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 def dfs(i,l,s): global ans for j in range(l+1,N-K+1+i): if i == K-1: if (s+A[j]) % 998244353 <= (s+A[j]) % 998: ans += 1 else: dfs(i+1,j,s+A[j]) dfs(0,-1,0) print(ans % 998)