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