from itertools import combinations N, K = map(int, input().split()) A = list(map(int, input().split())) ans = 0 for comb in combinations(range(N), K): S998 = 0 S998244353 = 0 for c in comb: S998 = (S998 + A[c]) % 998 S998244353 = (S998244353 + A[c]) % 998244353 if S998244353 <= S998: ans += 1 print(ans%998)