{"problem":{"name":"A. Romaji","description":{"content":"Vitya has just started learning Berlanese language. It is known that Berlanese uses the Latin alphabet. Vowel letters are \"_a_\", \"_o_\", \"_u_\", \"_i_\", and \"_e_\". Other letters are consonant. In Berlan","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF1008A"},"statements":[{"statement_type":"Markdown","content":"Vitya has just started learning Berlanese language. It is known that Berlanese uses the Latin alphabet. Vowel letters are \"_a_\", \"_o_\", \"_u_\", \"_i_\", and \"_e_\". Other letters are consonant.\n\nIn Berlanese, there has to be a vowel after every consonant, but there can be any letter after any vowel. The only exception is a consonant \"_n_\"; after this letter, there can be any letter (not only a vowel) or there can be no letter at all. For example, the words \"_harakiri_\", \"_yupie_\", \"_man_\", and \"_nbo_\" are Berlanese while the words \"_horse_\", \"_king_\", \"_my_\", and \"_nz_\" are not.\n\nHelp Vitya find out if a word $s$ is Berlanese.\n\n## Input\n\nThe first line of the input contains the string $s$ consisting of $|s|$ ($1\\leq |s|\\leq 100$) lowercase Latin letters.\n\n## Output\n\nPrint \"_YES_\" (without quotes) if there is a vowel after every consonant except \"_n_\", otherwise print \"_NO_\".\n\nYou can print each letter in any case (upper or lower).\n\n[samples]\n\n## Note\n\nIn the first and second samples, a vowel goes after each consonant except \"_n_\", so the word is Berlanese.\n\nIn the third sample, the consonant \"_c_\" goes after the consonant \"_r_\", and the consonant \"_s_\" stands on the end, so the word is not Berlanese.","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"Vitya 刚刚开始学习 Berlanese 语言。已知 Berlanese 使用拉丁字母。元音字母为 \"_a_\"、\"_o_\"、\"_u_\"、\"_i_\" 和 \"_e_\"。其他字母均为辅音。\n\n在 Berlanese 中，每个辅音后必须紧跟一个元音，但元音后可以跟任意字母。唯一的例外是辅音 \"_n_\"：在其后可以跟任意字母（不一定是元音），也可以没有字母。例如，单词 \"_harakiri_\"、\"_yupie_\"、\"_man_\" 和 \"_nbo_\" 是 Berlanese 词，而 \"_horse_\"、\"_king_\"、\"_my_\" 和 \"_nz_\" 则不是。\n\n请帮助 Vitya 判断一个单词 $s$ 是否为 Berlanese 词。\n\n输入的第一行包含一个字符串 $s$，由 $| s |$（$1 lt.eq | s | lt.eq 100$）个小写拉丁字母组成。\n\n如果每个辅音（除了 \"_n_\"）后面都紧跟一个元音，则输出 \"_YES_\"（不带引号）；否则输出 \"_NO_\"。\n\n你可以以任意大小写形式输出每个字母。\n\n在第一个和第二个样例中，每个辅音（除了 \"_n_\"）后面都跟了一个元音，因此该词是 Berlanese 词。\n\n在第三个样例中，辅音 \"_c_\" 出现在辅音 \"_r_\" 之后，且辅音 \"_s_\" 位于词尾，因此该词不是 Berlanese 词。\n\n## Input\n\n输入的第一行包含一个字符串 $s$，由 $| s |$（$1 lt.eq | s | lt.eq 100$）个小写拉丁字母组成。\n\n## Output\n\n如果每个辅音（除了 \"_n_\"）后面都紧跟一个元音，则输出 \"_YES_\"（不带引号）；否则输出 \"_NO_\"。你可以以任意大小写形式输出每个字母。\n\n[samples]\n\n## Note\n\n在第一个和第二个样例中，每个辅音（除了 \"_n_\"）后面都跟了一个元音，因此该词是 Berlanese 词。在第三个样例中，辅音 \"_c_\" 出现在辅音 \"_r_\" 之后，且辅音 \"_s_\" 位于词尾，因此该词不是 Berlanese 词。","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ s = s_1 s_2 \\dots s_{|s|} $ be a string of length $ |s| \\in \\mathbb{Z}^+ $, where each $ s_i \\in \\{a, b, \\dots, z\\} $.  \nLet $ V = \\{a, e, i, o, u\\} $ be the set of vowels.  \nLet $ C = \\{b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, y, z\\} $ be the set of consonants.  \nLet $ N = \\{n\\} \\subset C $ be the special consonant.\n\n**Constraints**  \n$ 1 \\leq |s| \\leq 100 $\n\n**Objective**  \nDetermine whether $ s $ is a Berlanese word, i.e., for every position $ i \\in \\{1, \\dots, |s|\\} $:  \n- If $ s_i \\in C \\setminus N $, then either:  \n  - $ i < |s| $ and $ s_{i+1} \\in V $, or  \n  - $ i = |s| $ (invalid — no vowel follows).  \n- If $ s_i = n $, no restriction on $ s_{i+1} $.  \n- If $ s_i \\in V $, no restriction.\n\n**Output**  \n$$\n\\begin{cases}\n\\text{YES} & \\text{if } \\forall i \\in \\{1, \\dots, |s|\\},\\ s_i \\in C \\setminus N \\implies (i < |s| \\land s_{i+1} \\in V) \\\\\n\\text{NO} & \\text{otherwise}\n\\end{cases}\n$$","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF1008A","tags":["implementation","strings"],"sample_group":[["sumimasen","YES"],["ninja","YES"],["codeforces","NO"]],"created_at":"2026-03-03 11:00:39"}}