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.
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.
Hi!
YES
Codeforces
NO
a+b=c
NO
hq-lowercase
NO
Q
YES
9
YES
H
YES
+
NO
~
NO
dEHsbM'gS[\brZ_dpjXw8f?L[4E"s4Zc9*(,j:>p$}m7HD[_9nOWQ\uvq2mHWR
YES
tt6l=RHOfStm.;Qd$-}zDes*E,.F7qn5-b%HC
YES
@F%K2=%RyL/
NO
juq)k(FT.^G=G\zcqnO"uJIE1_]KFH9S=1c"mJ;F9F)%>&.WOdp09+k`Yc6}"6xw,Aos:M\_^^:xBb[CcsHm?J
YES
6G_"Fq#<AWyHG=Rci1t%#Jc#x<Fpg'N@t%F=``YO7\Zd;6PkMe<#91YgzTC)
YES
Fvg_~wC>SO4lF}*c`Q;mII9E{4.QodbqN]C
YES
p-UXsbd&f
NO
<]D7NMA)yZe=`?RbP5lsa.l_Mg^V:"-0x+$3c,q&L%18Ku<HcA\s!^OQblk^x{35S'>yz8cKgVHWZ]kV0>_
YES
f.20)8b+.R}Gy!DbHU3v(.(=Q^`z[_BaQ}eO=C1IK;b2GkD\{\Bf"!#qh]
YES
}do5RU<(w<q["-NR)IAH_HyiD{
YES
Iy^.,Aw*,5+f;l@Q;jLK'G5H-r1Pfmx?ei~`CjMmUe{K:lS9cu4ay8rqRh-W?Gqv!e-j*U)!Mzn{E8B6%~aSZ~iQ_QwlC9_cX(o8
YES
sKLje,:q>-D,;NvQ3,qN3-N&tPx0nL/,>Ca|z"k2S{NF7btLa3_TyXG4XZ:`(t&"'^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B<A&UO+p?7liE>(x&RFgG2~\(
NO
Qv)X8
YES
aGv7,J@&g1(}E3g6[LuDZwZl2<v7IwQA%"R(?ouBD>_=y"3Kf%^>vON<a^T\G^ootgE@whWmZo=[ex|F
YES
e{}2vQ+/r@p0}cLKNe4MCk
YES
mzbmweyydiadtlcouegmdbyfwurpwbpuvhifnuapwyndmhtqvkgkbhtytszotwflegsjzzszfwtzfpnscguemwrczqxycivdqnkH
YES
Qzbmweyydiadtlcouegmdbyfwurpwbpuvhifnuapwyndmhtqvkgkbhtytszotwflegsjzzszfwtzfpnscguemwrczqxycivdqnky
YES
mzbmweyydiadtlcouegmdbyfwurpwb9uvhifnuapwyndmhtqvkgkbhtytszotwflegsjzzszfwtzfpnscguemwrczqxycivdqnky
YES
1H1
YES
+Q
YES
1ab
NO
!
NO
0+
NO
+H
YES
cH
YES
+8
NO
8+
NO
++++++++++++++++++++++++++
NO
(+)
NO
H+
YES
a!
NO
++++++++++++++
NO
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
NO
8
NO
3
NO
HQ9
YES
+++H
YES
++++++++++
NO
HHHHHHH
YES
abacabaH
YES
+G
NO
def HQ9_plus_output(a):
    for char in a:
        if char in "H Q 9 ":
            return "YES"
    return "NO"
a = input()
output = HQ9_plus_output(a)
print(output)