#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char s[101], ans[4] = "NO";
  scanf("%s", s);
  int i;
  for (i = 0; i < strlen(s); i++) {
    if (s[i] == 'H' || s[i] == 'Q' || s[i] == '9')
      ans[0] = 'Y', ans[1] = 'E', ans[2] = 'S';
  }
  printf("%s\n", ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeb8(%rip),%eax
mov    %eax,-0x74(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x0,-0x78(%rbp)
mov    -0x78(%rbp),%eax
mov    %eax,-0x7c(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x7c(%rbp),%eax
cmp    %ecx,%eax
jge    11d3 <main+0xa3>
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x48,%eax
je     11b4 <main+0x84>
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x51,%eax
je     11b4 <main+0x84>
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x39,%eax
jne    11c0 <main+0x90>
movb   $0x59,-0x74(%rbp)
movb   $0x45,-0x73(%rbp)
movb   $0x53,-0x72(%rbp)
jmp    11c5 <main+0x95>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1162 <main+0x32>
lea    -0x74(%rbp),%rsi
lea    0xe29(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
movl   $0x4f4e,0xc(%rsp)
lea    0xeb5(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    11b5 <main+0x85>
xor    %ebx,%ebx
lea    0x10(%rsp),%r14
mov    $0x1008001,%r15d
jmp    1193 <main+0x63>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    11b5 <main+0x85>
movzbl 0x10(%rsp,%rbx,1),%eax
add    $0xc7,%al
cmp    $0x18,%al
ja     1180 <main+0x50>
movzbl %al,%eax
bt     %rax,%r15
jae    1180 <main+0x50>
movw   $0x4559,0xc(%rsp)
movb   $0x53,0xe(%rsp)
jmp    1180 <main+0x50>
lea    0xe47(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.ans = [4 x i8] c"NO\00\00"
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [101 x i8]
%3 = alloca [4 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [4 x i8]* %3 to i8*
%6 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
store i32 0, i32* %4
br label %8
8: ; preds = %39, %0
%9 = load i32, i32* %4
%10 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
%12 = icmp slt i32 %9, %11
br i1 %12, label %13, label %42
13: ; preds = %8
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 72
br i1 %19, label %34, label %20
20: ; preds = %13
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 81
br i1 %26, label %34, label %27
27: ; preds = %20
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 57
br i1 %33, label %34, label %38
34: ; preds = %27, %20, %13
%35 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 89, i8* %35
%36 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 69, i8* %36
%37 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 83, i8* %37
br label %38
38: ; preds = %34, %27
br label %39
39: ; preds = %38
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
br label %8
42: ; preds = %8
%43 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%44 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %43)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [101 x i8]
%2 = alloca i32
%3 = bitcast i32* %2 to [4 x i8]*
%4 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
store i32 20302, i32* %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = call i32 @strlen(i8* %4)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %0
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
br label %12
12: ; preds = %9, %17
%13 = phi i64 [ 0, %9 ], [ %18, %17 ]
%14 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 %13
%15 = load i8, i8* %14
switch i8 %15, label %17 [
i8 72, label %16
i8 81, label %16
i8 57, label %16
]
16: ; preds = %12, %12, %12
store i8 89, i8* %5
store i8 69, i8* %10
store i8 83, i8* %11
br label %17
17: ; preds = %12, %16
%18 = add nuw nsw i64 %13, 1
%19 = call i32 @strlen(i8* %4)
%20 = sext i32 %19 to i64
%21 = icmp slt i64 %18, %20
br i1 %21, label %12, label %22
22: ; preds = %17, %0
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}