Like a true gamer, you are truly a W-key (forward moving) player. You would never do something as shameful as S-keying (going backwards), so you have removed that key from your keyboard entirely.
Your friends have recently introduced you to the genre of platformer games. To your dismay, you have noticed that in these games, you have to move right (D-key) instead of forward. As you want to demonstrate to your friends that you are the superior gamer, you have also removed your A-key (moving left).
One level of the platformer you are playing right now works as follows. Initially, there are some enemies to the left and right of you. Every second, you can do exactly one of the following actions:
Every action has a cooldown of 1 second, so you cannot do the same action twice in a row. After your action, every enemy moves one space closer to you. Note that you cannot move right twice in a row, and you also cannot skip an action.
If at any point an enemy touches you, you die. Note that it is allowed to move outside the visible level (there are no enemies there).
You need to determine if it is possible to survive the level and kill all enemies.
The first line contains one integer $$$t$$$ ($$$1 \leq t \leq 5 \cdot 10^4$$$), the number of levels.
Each level consists of:
The layout consists of 'X', '.', and '#' , your position, an empty field, and an enemy respectively. You are at exactly one position, and there is at least one enemy.
The sum over the length of all strings $$$s$$$ does not exceed $$$10^5$$$.
For each level, if it is possible to beat it, output "Yes". Otherwise, output "No".
5#..X.##.#X.##X#X.##......##X
Yes Yes No No Yes
This is one possible way to beat the first level of the sample:
#..X.# $$$\xrightarrow{\text{L}}$$$ #..X.# $$$\to$$$ .#.X#. $$$\xrightarrow{\text{R}}$$$ .#.X.. $$$\to$$$ ..#X.. $$$\xrightarrow{\text{D}}$$$ ..#.X. $$$\to$$$ ...#X. $$$\xrightarrow{\text{L}}$$$ ....X.
Here, L means attacking left, R means attacking right, and D means moving right. If nothing is written above the arrow, the enemies move.