3654.HQ

Time Limit: 1s Memory Limit: 256MB

The famous joke programming language HQ9+ has only 4 commands. In this problem we will explore its subset - a language called HQ...

Input Format(From the terminal/stdin)

The only line of the input is a string between 1 and 106 characters long.

Output Format(To the terminal/stdout)

Output "Yes" or "No".

Sample Input 1

Copy
HHHH
    \n

Sample Output 1

Copy
Yes
   \n

Sample Input 2

Copy
HQHQH
     \n

Sample Output 2

Copy
No
  \n

Sample Input 3

Copy
HHQHHQH
       \n

Sample Output 3

Copy
No
  \n

Sample Input 4

Copy
HHQQHHQQHH
          \n

Sample Output 4

Copy
Yes
   \n

Hints

The rest of the problem statement was destroyed by a stray raccoon. We are terribly sorry for the inconvenience.

Submit

请先 登录

© 2025 FAQs