Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n, m = map(int, input().split())
- a = list(map(int, input().split()))
- dp = [0] * 10000
- dp[0] = 1
- for i in a:
- for j in range(m, -1, -1):
- if dp[j] == 1:
- dp[j + i] = 1
- if dp[m] == 1:
- print('YES')
- else:
- print('NO')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement