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