a = eval(input())

for i in range(len(a)):

    if a[i] == "9":

        print("Yes")

        exit()

print("No")

a = eval(input())

print(("Yes" if a[0] == "9" or a[1] == "9" else "No"))

a = eval(input())
for i in range(len(a)):
    if a[i] == "9":
        print("Yes")
        exit()
print("No")

a = eval(input())
print(("Yes" if a[0] == "9" or a[1] == "9" else "No"))

-for i in range(len(a)): -    if a[i] == "9": -        print("Yes") -        exit() -print("No") +print(("Yes" if a[0] == "9" or a[1] == "9" else "No"))