#K83497. Palindromic Array Check

    ID: 36210 Type: Default 1000ms 256MiB

Palindromic Array Check

Palindromic Array Check

In this problem, you are given an array of integers. Your task is to determine whether the array is a palindrome. An array is said to be palindromic if it reads the same forwards and backwards. Formally, given an array A of size n, the array is a palindrome if:

\( A[i] = A[n-i+1] \) for all \( 1 \leq i \leq n \).

Print "YES" if the array is a palindrome, otherwise print "NO".

inputFormat

The first line contains a single integer n (the size of the array). The second line contains n integers separated by spaces, representing the elements of the array.

outputFormat

Output a single line containing "YES" if the array is a palindrome and "NO" otherwise.

## sample
5
1 2 3 2 1
YES