Detect a Pal
In this problem, you're given a list of numbers, and must determine whether that list is a palindrome.
In other terms, you must determine whether the list would still be the same if the order of its elements were reversed.
Input
First, you are given an integer \(1 \leq n \leq 10\), representing the amount of integers in the list.
Then, you are given \(n\) integers \(1 \leq a_i \leq 100\), each representing an individual element of the list.
Output
The output consists of a single word. If the list is a palindrome, then that word is Yes; otherwise, it is No.
Examples
Example 1
Input:
2
15 51
Output:
No
The list [15, 51] reversed would be [51, 15]. Just to be clear, we're determining whether the list would be the same if the order of its elements were reversed.
Example 2
Input:
3
2 5 2
Output:
Yes
Comments