n,k=map(int,input().split()) a=list(map(int,input().split())) p=set() for i in range(1<=k: p.add(sum(q)) p.add(l) print(len(p))