# Game on a Strip SOLUTIONS ARRGAME

Page Contents

### Game on a Strip SOLUTIONS ARRGAME

Tzuyu gave Nayeon a portion of N cells (numbered 1 through N) for her birthday. This strip is depicted by an arrangement A1,A2,… ,A, where for each legitimate I, the I-th cell is blocked if Ai=1 or free if Ai=0. Tzuyu and Nayeon are going to utilize it to play a game with the accompanying standards:

The players exchange turns; Nayeon plays first.

At first, the two players are outside of the strip. Notwithstanding, note that subsequently during the game, their positions are consistently extraordinary.

In each turn, the current player ought to pick a free cell and move there. A while later, this cell gets blocked and the players can’t move to it once more.

On the off chance that it is the current player’s first turn, she may move to any free cell.

Else, she may just move to one of the left and right nearby cells, for example from a cell c, the current player may just move to the cell c−1 or c+1 (in the event that it is free).

In the event that a player can’t move to a free cell during her turn, this player loses the game.

Nayeon and Tzuyu are brilliant, so the two of them play ideally. Since it is Nayeon’s birthday, she needs to know whether she can beat Tzuyu. Discover who wins.

Info

The principal line of the info contains a solitary number T indicating the quantity of experiments. The portrayal of T experiments follows.

The primary line of each experiment contains a solitary number N.

The subsequent line contains N space-isolated whole numbers A1,A2,… ,AN.

Yield

For each experiment, print a solitary line containing the string “Yes” if Nayeon dominates the match or “No” if Tzuyu wins (without cites).

Imperatives

1≤T≤40,000

2≤N≤3⋅105

0≤Ai≤1 for each substantial I

A1=AN=1

the entirety of N over all experiments doesn’t surpass 106

Subtasks

Subtask #1 (50 focuses): Ai=0 for every I (2≤i≤N−1)

Subtask #2 (50 focuses): unique imperatives

Model Input

1 0 1

1 0 1 0 1

1 0 1

Model Output

Truly

No

Truly

No

Clarification

Model case 1: Since both Nayeon and Tzuyu play ideally, Nayeon can begin for example by moving to cell 4, which at that point gets blocked. Tzuyu needs to pick either the cell 3 or the cell 5, which additionally gets blocked. Nayeon is then left with just one void cell close to cell 4 (the one Tzuyu didn’t pick); after she moves there, Tzuyu can’t move, so she loses the game.

Model case 2: Regardless of what cell Nayeon moves to toward the beginning, Tzuyu will consistently have the option to beat her.