#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 nn and an integer xx. In one move, you can take 22 adjacent elements of the array whose sum equals xx and remove them. After that, the size of the array will decrease by 22. 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 nn, xx --- the size of the array and the sum of the elements to be removed (1n31051 \leq n \leq 3 \cdot 10^5, 109x109-10^9 \leq x \leq 10^9).

The second line of each test case contains nn numbers aia_i --- the elements of the game array (109ai109-10^9 \leq a_i \leq 10^9).

Output Format

Print Yes\texttt{Yes}, if Xeni can complete the level, and No\texttt{No} 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