#K90522. Palindrome List Test

    ID: 37771 Type: Default 1000ms 256MiB

Palindrome List Test

Palindrome List Test

Given a list of integers, determine whether the list is a palindrome. A list is considered a palindrome if it reads the same backwards as forwards. In other words, for a list (a_1, a_2, \dots, a_N), it is a palindrome if (a_i = a_{N-i+1}) for every (1 \leq i \leq N).

inputFormat

The first line contains an integer (T) (the number of test cases). Each test case consists of two lines. The first line of a test case contains an integer (N) representing the number of elements in the list. The second line contains (N) space-separated integers.

outputFormat

For each test case, output a single line with the word "Yes" if the list is a palindrome, or "No" otherwise.## sample

4
5
1 2 3 2 1
4
1 2 2 1
3
1 2 3
6
1 2 3 3 2 1
Yes

Yes No Yes

</p>