I. Cities Solitaire
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output

Bytica is playing the solitaire game based on the well-known Cities game.

In the solitaire version, you have the list of $$$n$$$ city names, and your goal is to arrange them in sequence such as for any $$$1 \le i \lt n$$$ the last letter of $$$i$$$-th word is the first letter of $$$i+1$$$-st word, and the last letter of the $$$n$$$-th word is the first letter of the first word.

Given the list of city names, prepared by Bytica, check if she can reach the goal of the solitaire game.

Input

The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 10^4$$$) — the number of cities in the list. Each of the following $$$n$$$ lines contains one city name — the non-empty string $$$s_i$$$, composed from lowercase English letters ($$$1 \le |s_i| \le 30$$$).

Output

Print "YES" if Bytica can reach the goal of the game, or "NO" otherwise.

Examples
Input
4
kyiv
minsk
vinnytsia
amsterdam
Output
YES
Input
3
paris
stockholm
miami
Output
NO