N,K=map(int,input().split()) A=list(map(int,input().split())) A.sort(reverse=True) dp=[K] for bit in range(1,1<