Intel Code Challenge Elimination Round (Div. 1 + Div. 2, combined)
B
Verse Pattern
Codeforces
1200
原题
← AC →
翻译中…

You are given a text consisting of $*n*$ lines. Each line contains some space-separated words, consisting of lowercase English letters.

翻译中…

We define a syllable as a string that contains exactly one vowel and any arbitrary number (possibly none) of consonants. In English alphabet following letters are considered to be vowels: 'a', 'e', 'i', 'o', 'u' and 'y'.

翻译中…

Each word of the text that contains at least one vowel can be divided into syllables. Each character should be a part of exactly one syllable. For example, the word "mamma" can be divided into syllables as "ma" and "mma", "mam" and "ma", and "mamm" and "a". Words that consist of only consonants should be ignored.

翻译中…

The verse patterns for the given text is a sequence of $*n*$ integers $*p*_{1}, *p*_{2}, ..., *p*_{*n*}$. Text matches the given verse pattern if for each $*i*$ from $1$ to $*n*$ one can divide words of the $*i*$-th line in syllables in such a way that the total number of syllables is equal to $*p*_{*i*}$.

翻译中…

You are given the text and the verse pattern. Check, if the given text matches the given verse pattern.

翻译中…

Input

翻译中…

The first line of the input contains a single integer $*n*$ ($1 ≤ *n* ≤ 100$) — the number of lines in the text.

翻译中…

The second line contains integers $*p*_{1}, ..., *p*_{*n*}$ ($0 ≤ *p*_{*i*} ≤ 100$) — the verse pattern.

翻译中…

Next $*n*$ lines contain the text itself. Text consists of lowercase English letters and spaces. It's guaranteed that all lines are non-empty, each line starts and ends with a letter and words are separated by exactly one space. The length of each line doesn't exceed $100$ characters.

翻译中…

Output

翻译中…

If the given text matches the given verse pattern, then print "YES" (without quotes) in the only line of the output. Otherwise, print "NO" (without quotes).

翻译中…

Note

翻译中…

In the first sample, one can split words into syllables in the following way:

翻译中…

in-tel
co-de
ch al-len-ge

翻译中…

Since the word "ch" in the third line doesn't contain vowels, we can ignore it. As the result we get $2$ syllabels in first two lines and $3$ syllables in the third one.

翻译中…

样例

Input #1
3
2 2 3
intel
code
ch allenge
Output #1
YES
InputCopy OutputCopy
Input #2
4
1 2 3 1
a
bcdefghi
jklmnopqrstu
vwxyz
Output #2
NO
InputCopy OutputCopy
Input #3
4
13 11 15 15
to be or not to be that is the question
whether tis nobler in the mind to suffer
the slings and arrows of outrageous fortune
or to take arms against a sea of troubles
Output #3
YES
InputCopy OutputCopy
题目信息
题号
722B
时间限制
1 s
内存限制
256 MB
标签
模拟
字符串

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。