n, k = map(int, input().split()) d = [[] for _ in range(k + 1)] d[0].append(0) for x in map(int, input().split()): for i in range(k)[::-1]: for s in d[i]: d[i+1].append(s + x) ans = sum(s % 998244353 <= s % 998 for s in d[k]) % 998 print(ans)