#P15311. [VKOSHP 2025] Array Depletion
[VKOSHP 2025] Array Depletion
Description
After a long journey home, the hare Xeni decided to play a game on her bunny phone.
The level in the game is described by an array of length and an integer . In one move, you can take adjacent elements of the array whose sum equals and remove them. After that, the size of the array will decrease by . You win the level if, after a certain number of moves, the array becomes empty.
The current level seemed very difficult to her, and she even doubted whether it was possible to complete it --- after all, there might be a situation where the game creators did not come up with more levels and made the last level impossible. Xeni turned to you for help --- tell her if it is possible to complete this game.
Input Format
The first line contains two integers , --- the size of the array and the sum of the elements to be removed (, ).
The second line of each test case contains numbers --- the elements of the game array ().
Output Format
Print , if Xeni can complete the level, and otherwise.
4 10
6 7 3 4
Yes
1 7
7
No
6 -3
-3 -9 6 3 -6 0
Yes
6 4
1 5 2 4 33 0
No
京公网安备 11011102002149号