2505: A Math game

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:68 解决:15

题目描述

    Recently, Losanto find an interesting Math game. The rule is simple: Tell you a number H, and you can choose some numbers from a set {a1,a2,......,an}.If the sum of the number you choose is H, then you win. Losanto just want to know whether he can win the game.

输入

    There are several cases.
    In each case, there are two numbers in the first line n (the size of the set) and H. The second line has n numbers {a1,a2,......,an}.

    0<n<=40, 0<=H<10^9, 0<=ai<10^9,All the numbers are integers.

输出

    If Losanto could win the game, output "Yes" in a line. Else output "No" in a line.

样例输入 复制

10 87
2 3 4 5 7 9 10 11 12 13
10 38
2 3 4 5 7 9 10 11 12 13

样例输出 复制

No
Yes

来源/分类