import itertools n,k = map(int,input().split()) a = list(map(int,input().split())) nl = [i for i in range(n)] ans = 0 for comb in list(itertools.combinations(nl,k)): s = 0 for i in list(comb): s += a[i] s998 = s % 998 s9982 = s % 998244353 if s9982 <= s998: ans += 1 print(ans % 998)