686. Palindrome Linked List

0

Easy

Given the *head* of a singly linked list, determine whether the list is a palindrome.

Input Format

The first line of input contains the size of the linked list. The second line contains the elements of the linked list.

Output Format

Print True if the linked list is a palindrome, and False otherwise.

Example

Input

6 2 3 4 4 3 2

Output

True

Constraints

The number of nodes in the list is between 1 and 105, inclusive. Each node's value is an integer between 0 and 9, inclusive.
Loading...

View Submissions

Console