A craft strand is a singly linked chain of bead tokens, each carrying an integer. Determine whether the strand is a mirror image of itself: the sequence of values from head to tail is identical to the sequence from tail to head.
Input format
Line 1: an integer n, the number of beads.
Line 2: n space-separated integers, the bead values from head to tail (empty line when n is 0).
Output format
Print YES if the strand reads the same in both directions, otherwise NO.
Constraints
- 0 <= n <= 100000
- -1000000000 <= each value <= 1000000000