CodeLab Academy 📞 9936 6696
← List Python · Level 10: Algorithms Code · 100 points ← #939 #941 →

#940. Subset sum

You get a list and k. If some subset adds up to k, print `Yes`, otherwise `No`. ### Input The first line has n, the second line has n integers separated by spaces. The third line has k. ### Output `Yes` or `No`.

Examples

Input
6
14 8 8 8 22 3
49
Output
Yes
Input
9
12 20 5 30 16 19 12 22 12
28
Output
Yes

💡 You can solve it with Python, JavaScript or blocks. Read the input line by line with input(). Don't print a question (like input("Number: ")). Print exactly what the output asks for, nothing more.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!