Verse Pattern
time limit per test 1 second memory limit per test 256 megabytes
input standard input output standard output

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 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 p1, p2, …, pn. Text matches the given verse pattern if for each i from 1to 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 pi.
You are given the text and the verse pattern. Check, if the given text matches the given verse pattern.

传送门:CF722B

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 p1,...,pn (0≤pi≤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 100characters.

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).

Sample Input

1
2
3
4
5
3
2 2 3
intel
code
ch allenge

Sample Output

1
YES

题解

统计一下元音字母个数即可,注意一个syllable只能有一个元音,所以数量相等就能通过,而不等就不行,水题
## AC code:(不包含输入类)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import java.io.*;  
import java.util.*;

public class Main {

public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
while(sc.hasNext()){
int n=sc.nextInt();
int[]jl=new int[n+10];
for(int i=0;i<n;i++){
jl[i]=sc.nextInt();
}
sc.nextLine();
boolean flag=true;
String []s=new String[n+10];
for(int i=0;i<n;i++){
s[i]=sc.nextLine();
//System.out.println(s[i]);
//System.out.println(s[i]);
int js=0;
for(int j=0;j<s[i].length();j++){
if((s[i].charAt(j)=='a'||s[i].charAt(j)=='e'||s[i].charAt(j)=='i'||s[i].charAt(j)=='o'||s[i].charAt(j)=='u'||s[i].charAt(j)=='y')){
js++;
}

}
if(js!=jl[i]){
flag=false;

}
//System.out.println(js);
}
if(flag==true){
System.out.println("YES");
}
else
System.out.println("NO");
}

}

}