l, target = map(int, input().split())
cash = list(map(int, input().split()))
dp = [float("inf")] * (target + 1)
dp[0] = 0
for i in range(1, target + 1):
    temp = []
    for j in range(l):
        if i - cash[j] < 0:
            continue
        dp[i] = min(dp[i], dp[i - cash[j]] + 1)
if dp[-1] == float("inf"):
    print(-1)
else:
    print(dp[-1])