Skip to content
UPEEC

Subset Sum

Medium#dynamic-programming· solved by 0 · time limit 2.0 s

Is there a subset of the positive integers whose sum is exactly tt? Print Yes or No.

Input

nn, then nn positive integers, then tt.

Output

Yes or No.

Constraints

1≤n≤1001 \le n \le 100, 1≤ai≤10001 \le a_i \le 1000, 1≤t≤1051 \le t \le 10^5

Sample 1

Input

6
3 34 4 12 5 2
9

Output

Yes

Sample 2

Input

6
3 34 4 12 5 2
30

Output

No

Sign in or join free to run and submit your solution.