N,K = map(int,input().split()) A = list(map(int,input().split())) B = set() for i in range(1<>k) & 1: cnt += 1 cum += A[k] prod *= A[k] if cnt>=K: B.add(cum) B.add(prod) print(len(B))