#K8791. Mirrored Sequence Check

    ID: 37191 Type: Default 1000ms 256MiB

Mirrored Sequence Check

Mirrored Sequence Check

You are given an integer N and a sequence of N integers. Your task is to determine whether the sequence is a mirrored sequence (i.e., a palindrome).

A sequence A is mirrored if for every integer \( 0 \leq i < \frac{N}{2} \), the following condition holds:

\( A[i] = A[N-i-1] \)

If the condition is satisfied, output Yes, otherwise output No.

inputFormat

The input is given from stdin and consists of two lines:

  1. The first line contains a single integer N (1 ≤ N).
  2. The second line contains N space-separated integers representing the sequence A.

outputFormat

Print a single line to stdout containing Yes if the given sequence is a mirrored sequence, or No otherwise.

## sample
5
1 2 3 2 1
Yes