K. Knife Battle (Moving Right)
time limit per test
3 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

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:

  • move right — move $$$1$$$ space to the right.
  • attack left — if there is an enemy $$$1$$$ space to the left, that enemy is killed.
  • attack right — if there is an enemy $$$1$$$ space to the right, that enemy is killed.

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.

Input

The first line contains one integer $$$t$$$ ($$$1 \leq t \leq 5 \cdot 10^4$$$), the number of levels.

Each level consists of:

  • One string $$$s$$$ ($$$2 \leq |s| \leq 10^5$$$) , the layout of the level.

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$$$.

Output

For each level, if it is possible to beat it, output "Yes". Otherwise, output "No".

Example
Input
5
#..X.#
#.#X.#
#X#
X.##.
.....##X
Output
Yes
Yes
No
No
Yes
Note

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.