P12005 【MX-X10-T1】[LSOT-4] How to Write a Well-Formatted Problem Solution While Forgetting the Middle Part?

Background

Unfortunately, your article does not meet the recommendation criteria. The reason is: **Chinese characters** should be separated from **English letters, numbers, or formulas** by half-width spaces, but **Chinese punctuation marks** should **not** have spaces between them and **English letters, numbers, or formulas**.

Description

Given a Markdown article of length $n$, determine whether it satisfies: - **Chinese characters** are separated from **English letters, numbers, or formulas** by half-width spaces. - **Chinese punctuation marks** should **not** have spaces (regardless of quantity) between them and **English letters, numbers, or formulas**. In other words: - No adjacent **Chinese characters** and **English letters, numbers, or formulas** exist. - No pair of **Chinese punctuation marks** and **English letters, numbers, or formulas** has **only** spaces (any number) between them. If the article satisfies the conditions, output `Yes`. Otherwise, output `No`. For simplicity, the article is guaranteed to consist **only** of the characters `a@1$,_`, where: - `a` represents English letters. - `@` represents Chinese characters. - `1` represents numbers. - `$` represents formulas. **Note: This differs from the traditional meaning of `$`.** - `,` represents Chinese punctuation. - `_` represents spaces.

Input Format

One line containing a string of length $n$ composed solely of `a@1$,_`, representing the Markdown article.

Output Format

One line containing `Yes` if the article meets the criteria, or `No` otherwise.

Explanation/Hint

**Sample Explanation #1** The only Chinese character is adjacent to an English letter/number, violating the requirements. Hence, the article should be rejected. **Sample Explanation #2** All Chinese characters are properly separated from English letters/numbers/formulas by spaces. All Chinese punctuation marks have no spaces between them and English letters/numbers/formulas. The article meets the criteria. **Sample Explanation #3** The only Chinese punctuation mark and an English letter are separated only by spaces, violating the requirements. Hence, the article should be rejected. **Data Range** - For $20\%$ of the data: $n \le 3$. - For another $20\%$: no formulas exist. - For another $20\%$: no Chinese characters exist. - For all data: $1 \le n \le 100$, and the string contains only `a@1$,_`. Translation by DeepSeek R1