n, k = map(int, input().split()) A = list(map(int, input().split())) from collections import Counter C = Counter(A) limit = (1<>k)&1: continue if (dp>>(k-a))&1 and v == 1: ans += 1 if ans != 0: print(ans) else: print(-1)