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.

Examples

Input

Hi!


Output

YES


Input

Codeforces


Output

NO

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.
'''
delete all the vowels
insert . before each consonant
replace uppercase consonants with lowercase

NOTE:Vowels are letters "A", "O", "Y", "E", "U", "I",
and the rest are consonants

python codeforces.py
'''
'''
vowels=["a", "o", "y", "e", "u", "i"]

string = (input("")).lower()

ans=""
for letter in string:
    if letter not in vowels:
        ans+=("."+letter)

print(ans)
'''
'''
m,n = map(int, input("").split(' '))

if m%2!=0 or n%2!=0:
    print((m*int(n/2))+int(m/2))
else:
    print(m*int(n/2))
'''
'''
if m%2==0:
    print(int(m/2)*n)
elif n%2==0:
    print(int(n/2)*m)
else:
    print((int(m/2)*n)+int(n/2))
'''
'''
n = int(input(""))
x=0
code=[]

for i in range(n):
    code.append(input(""))

for line in code:
    if "++" in line:
        x+=1
    else:
        x-=1

print(x)
'''
'''
string=[]
for i in range(2):
    string.append(input("").lower())

if string[0]<string[1]:
    print(-1)

elif string[0]==string[1]:
    print(0)

else:
    print(1)
'''
'''
positions=input("")

if len(positions)<7:
    print("NO")

else:
    counter=[0,0]
    flag=0
    for i in positions:
        if i=='0':
            if counter[1]!=0:
                counter[1]=0
                counter[0]+=1
            else:
                counter[0]+=1
        elif i=='1':
            if counter[0]!=0:
                counter[0]=0
                counter[1]+=1
            else:
                counter[1]+=1
        #print(counter)

        if (counter[0]>=7 or counter[1]>=7) and flag==0:
            print("YES")
            flag=1

    if flag==0:
        print("NO")
'''
'''
sum_input=input("")
numbers=[]

for i in sum_input:
    if i != '+':
        numbers.append(int(i))

numbers=sorted(numbers)
ans=''
for j in numbers:
    ans=ans+(str(j)+'+')

ans=ans[:-1]

print(ans)
'''
'''
matrix=[]

for i in range(5):
    temp=input("").replace(' ','')
    matrix.append(list(temp))

#print(matrix)

for i in range(5):
    for j in range(5):
        if matrix[i][j]=='1':
            x=j
            y=i

print(abs(2-x)+abs(2-y))
'''
'''
word=input("")

print(word[0].upper()+word[1:])
'''
'''
R for red
G for green
B for blue

Count the minimum number of stones
to take from the table
so that any two neighboring stones
had different colors.
'''
'''
n=int(input(""))
s=input("")

print(sum([1 for i in range(n-1) if s[i]==s[i+1]]))
'''
'''
username = input("")
#odd->male->ignore him
#even->female->chat with her

letters=[]
counter=0

for char in username:
    if char not in letters:
        counter+=1
    letters.append(char)

if counter%2!=0:
    print("IGNORE HIM!")
else:
    print("CHAT WITH HER!")
'''

'''
a->exits
b->enters

n->number of tram's stops
'''
'''
n=int(input(""))

a=[]
b=[]

for j in range(n):
    x,y=map(int,input("").split())
    a.append(x)
    b.append(y)

current=0
m=[]
for i in range(n):
    current=current-a[i]+b[i]
    m.append(current)

print(max(m))
'''
'''
msg=input("")

def char_finder(s,char):
    counter=0
    for i in s:
        if i==char:
            counter+=1
    return counter

def index_finder(s,char):
    if char_finder(s,char)<=1:
        for i in range(len(s)):
            if s[i]==char:
                return i
    else:
        index=[]
        for i in range(len(s)):
            if s[i]==char:
                index.append(i)
        return index

def my_min(x):
    if isinstance(x,list):
        return min(x)
    else:
        return x

def my_max(x):
    if isinstance(x,list):
        return max(x)
    else:
        return x

l=index_finder(msg,'l')
if isinstance(l,int):
    print("NO")

else:
    h=my_min([i for i in range(len(msg)) if msg[i]=='h'])+1
    o=my_max([i for i in range(len(msg)) if msg[i]=='o'])+1

    if o>h:
        flag=False
        s=msg[h:o]

        for i in s:
            if i=='e':
                e=s.find('e')+1
                s1=s[e:]
                for j in s1:
                    if j=='l':
                        l=s1.find('l')+1
                        s2=s1[l:]
                        for k in s2:
                            if k=='l':
                                ll=s2.find('l')+1
                                s3=s2[ll:]
                                if 'o' in s3:
                                    flag=True
        if flag:
            print("YES")
        else:
            print("NO")
'''
'''
n=int(input(""))
student=list(input("").split(" "))
taxi=0
three=[]
two=[]
one=[]
for i in student:
    if i=='4':
        taxi+=1
    elif i=='3':
        three.append(3)
    elif i=='2':
        two.append(2)
    else:
        one.append(1)

if len(three)>len(one):
    taxi+=len(three)
    #we dont need the lists one and three anymore
    if len(two)%2==0:
        taxi+=int(len(two)/2)
    else:
        taxi+=(int(len(two)/2)+1)

elif len(one)>len(three):
    taxi+=len(three)
    #we dont need the list three anymore
    for i in range(len(three)):#???
        one.remove(1)
    if len(one)%2==0:
        for i in range(int(len(one)/2)):
            two.append(2)
        if len(two)%2==0:
            taxi+=int(len(two)/2)
        else:
            taxi+=(int(len(two)/2)+1)
    else:
        # arta kalan 1 var
        for i in range(int(len(one)/2)):
            two.append(2)
            for j in range(2):
                one.remove(1)
        if len(two)%2==0:
            taxi+=int((len(two)/2)+len(one))
        else:
            taxi+=(int(len(two)/2)+1)

else:
    taxi+=len(one)
    #one ve three ile işim kalmadı
    if len(two)%2==0:
        taxi+=int(len(two)/2)
    else:
        taxi+=(int(len(two)/2)+1)

print(taxi)
'''
'''
k,n,w=map(int,input("").split(" "))
cost=0
for i in range(1,w+1):
    cost+=(k*i)
if cost>n:
    print(cost-n)
else:
    print(0)
'''
'''
n=int(input(""))
coins=sorted(list(map(int,input("").split(" "))),reverse=True)

for i in range(len(coins)):
    if sum(coins[:i+1])>sum(coins[i+1:]):
        print(i+1)
        break
'''
s=input("")
cmds=["H","Q","9"]
flag=any([True if i in cmds else False for i in s])
if flag:
    print("YES")
else:
    print("NO")









