Codeforces Beta Round 96 (Div. 2)
A
HQ9+
Codeforces
900
原题
←B →
翻译中…

HQ9+ is a joke programming language which has only four one-character instructions:

翻译中…
  • "H" prints "Hello, World!",
  • "Q" prints the source code of the program itself,
  • "9" prints the lyrics of "99 Bottles of Beer" song,
  • "+" increments the value stored in the internal accumulator.
翻译中…

Instructions "H" and "Q" are case-sensitive and must be uppercase. The characters of the program which are not instructions are ignored.

翻译中…

You are given a program written in HQ9+. You have to figure out whether executing this program will produce any output.

翻译中…

Input

翻译中…

The input will consist of a single line $*p*$ which will give a program in HQ9+. String $*p*$ will contain between 1 and 100 characters, inclusive. ASCII-code of each character of $*p*$ will be between 33 (exclamation mark) and 126 (tilde), inclusive.

翻译中…

Output

翻译中…

Output "YES", if executing the program will produce any output, and "NO" otherwise.

翻译中…

Note

翻译中…

In the first case the program contains only one instruction — "H", which prints "Hello, World!".

翻译中…

In the second case none of the program characters are language instructions.

翻译中…

样例

Input #1
Hi!
Output #1
YES
InputCopy OutputCopy
Input #2
Codeforces
Output #2
NO
InputCopy OutputCopy
题目信息
题号
133A
时间限制
2 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。