Two players play a game on a cycle. A cycle is given, and every edge is labelled with a non-negative integer; at least one of these integers is 0. A coin is placed on one vertex of the cycle, and the game starts from that vertex. The two players alternate turns, and on their turn the current player does the following.
The game ends when a player, on their turn, cannot move because every edge incident to the vertex holding the coin equals 0. That player loses.
Figure 1 shows one play of the game. Here Alice moves first and Bob moves second. In the starting position (a) the only edge Alice can use is the right edge of the vertex holding the coin, so she lowers its value from 2 to 0 and moves the coin along it, turning (a) into (b). Bob then has only the down edge available and lowers it from 5 to 1, turning (b) into (c). In (c) Alice takes the up edge and lowers it from 1 to 0, turning (c) into (d). Finally, in (d) Bob has no move because every edge incident to his vertex is 0, so Alice wins.

(a) Alice

(b) Bob

(c) Alice

(d) Bob
Figure 1: An example of the cycle game (the coin sits on the black vertex).
Whenever the game starts from the position in Figure 1 (a), the first player can always win no matter how the second player responds; in other words, the first player has a winning strategy from that position.
Given a starting position, decide whether the first player has a winning strategy.
The first line contains the number of test cases T.
Each test case consists of two lines. The first line contains an integer N (3≤N≤20), the number of vertices of the cycle. The second line contains the N non-negative integers written on the edges, listed in clockwise order starting from the vertex that holds the coin and separated by single spaces. At least one of these N integers is 0, and none of them exceeds 30.
For each test case, print exactly one line: YES if the first player has a winning strategy from the given starting position, and NO otherwise.