#C7436. Tom Wins Game
Tom Wins Game
Tom Wins Game
In this problem, you are given T test cases. For each test case, a positive integer n and a sequence of n integers are provided. The rules of the game are as follows: Tom wins if the number of elements is odd or if the smallest element in the sequence is not 1. Otherwise, Tom loses.
Formally, let ( n ) be the number of elements and ( a ) be the sorted sequence. Then Tom wins if
[ n \bmod 2 = 1 \quad \text{or} \quad \min(a) \neq 1 ]
Your task is to implement a program that reads from standard input and prints the result for each test case to standard output.
inputFormat
The first line of the input contains a single integer T, the number of test cases. For each test case, the first line contains a positive integer n indicating the number of elements in the sequence. The second line contains n space-separated integers representing the sequence.
outputFormat
For each test case, output a single line containing the string "YES" if Tom wins or "NO" otherwise.## sample
1
1
10
YES
</p>