#K56182. Palindrome Array Check

    ID: 30142 Type: Default 1000ms 256MiB

Palindrome Array Check

Palindrome Array Check

Given an array of integers, determine whether the array is a palindrome. An array is considered a palindrome if it reads the same backwards and forwards. Note that an empty array or an array with a single element is also treated as a palindrome.

Your program should read input from stdin and produce output to stdout.

Definition: An array A is a palindrome if \(A[i] = A[n-1-i]\) for all valid indices \(i\), where \(n\) is the length of the array.

inputFormat

The first line of input contains an integer \(n\) indicating the number of elements in the array. The second line contains \(n\) space-separated integers representing the array elements. Note that \(n\) can be zero, which indicates an empty array.

outputFormat

Output a single line: print "Yes" if the array is a palindrome, otherwise print "No".

## sample
5
1 2 3 2 1
Yes