Mosey Maker is practicing how to use words!
To help him with his words, he made up a bot to recognize them. However, his bot isn't that intelligent.
His bot recognizes words as a list of alphabetic characters. Mosey Maker's bot doesn't think long sequences of vowels or consonants are valid, so if more than consonants or vowels are seen in a row, his bot does not consider it a word. Note that the vowels are aeiouy
, and the consonants are bcdfghjklmnpqrstvwxyz
. Note that y
counts as both a consonant and a vowel.
Unfortunately, Mosey Maker lost his bot, and wants you to recode it.
Given a single word of characters, is it valid?
Constraints
The word will only contain lowercase alphabetic characters.
Subtask 1 [5/15]
The letter y
will not appear in the word.
Subtask 2 [10/15]
No additional constraints.
Input Specification
The first line will contain three integers, , , and .
The next line will be the word Mosey wants you to check.
Output Specification
Output YES
if the word is valid and NO
otherwise.
Sample Input 1
12 3 3
onomatopoeia
Sample Output 1
NO
Explanation for Sample Output 1
Note that although it is a valid English word, onomatopoeia
has too many trailing vowels to be a valid word.
Sample Input 2
8 2 4
aaybaaaa
Sample Output 2
YES
Sample Input 3
10 8 2
aayczttpqw
Sample Output 3
NO
Explanation for Sample Output 3
Note that since y
is both a vowel and a consonant, aay
is considered a string of vowels.
Sample Input 4
5 4 4
yyyyy
Sample Output 4
NO
Comments