import numpy as np import copy N, K = map(int, input().split()) A = list(map(int, input().split())) sumA = sum(A) prodA = np.prod(np.array(A)) ans = [sumA] if sumA != prodA: ans.append(prodA) q = [(A, sumA, prodA)] cnt = N - K while cnt > 0: new_q = [] for an, s, p in q: for a in an: isAdd = False if s-a not in ans: ans.append(s-a) isAdd = True if p//a not in ans: ans.append(p//a) isAdd = True if isAdd: new_an = copy.copy(an) new_an.remove(a) new_q.append((new_an, s-a, p//a)) q = new_q cnt -= 1 print(len(ans))