~/algor $ cat problems/massiv-palindrom
Palindrome array
Easy
1000 ms
128 MB
29%
A positive integer $n$ and an array of $n$ integers are given. If the array reads the same from left to right and from right to left (is a palindrome), print YES, otherwise NO.
Input
The first line contains a positive integer $n$. The second line contains $n$ integers separated by spaces.
Output
YES or NO accordingly.
Note
$1 \le n \le 1000$
$-10^{9} \le a_{i} \le 10^{9}$
Examples
Input #1
5 1 5 9 5 1
Output #1
YES
Input #2
4 1 2 3 1
Output #2
NO