409816: GYM103797 C Cute Sentences

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Cute Sentencestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

The string lecture ended 15 minutes ago. As usual, student Danon is still thinking about it. He likes to come up with weird problems for his professors to solve after the classes. What intrigues him the most on this subject is palindromes. How can a sentence with an arbitrary pattern gain a higher status among other sentences just because humans found it cute!?!?

Danon decides to create his own cute pattern! He defines a cute sentence as a sentence where its first word is an acronym of the whole sentence. This means that the first word should consist of the first letter of each word of the sentence, including itself, in the order they appear, without extra letters.

Now he asks for the professor to show how to code a program that, given a sentence, tells if it's cute or not. But the strings professor is Navarrosaur, who just turned 160 million years old, and has no energy to make this code. Thus, he gives this task to you!

Input

The first line contains a single integer $$$N$$$ ($$$0 < N \leq 100$$$) — the number of words in the sentence.

The second line contains $$$N$$$ non-empty strings $$$s_i$$$ ($$$|s_i| \leq 100$$$) — the sentence, separated by spaces.

All the words consist only of uppercase English letters.

Output

Print "Yes" if it's a cute sentence and "No" otherwise.

ExamplesInput
3
IME MELHOR ENGENHARIA
Output
Yes
Input
2
IME MITO
Output
No
Input
3
ITA TUDO MELHOR
Output
No
Input
5
AMAN MUITO ACIMA NESSA PARADA
Output
No

加入题单

算法标签: