from itertools import combinations N, K = map(int, input().split()) A = list(map(int, input().split())) """ 考察 全探索でも 28C8 = 3108105 通りで間に合いそう """ ans = 0 for comb in combinations(A, K): s998 = 0 for a in comb: s998 += a s998 %= 998 s998244353 = 0 for a in comb: s998244353 += a s998244353 %= 998244353 ans += s998244353 <= s998 ans %= 998 print(ans)