N,W = map(int,input().split()) a = list(map(int,input().split())) ans = set() for bit in range(1<