N=int(eval(input()))

if N//10==9 or N%10==9:

    print("Yes")

else:

    print("No")
N=eval(input())

if N[0]=="9" or N[1]=="9":

    print("Yes")

else:

    print("No")

N = int(eval(input()))
if N // 10 == 9 or N % 10 == 9:
    print("Yes")
else:
    print("No")

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

-N = int(eval(input())) -if N // 10 == 9 or N % 10 == 9: +N = eval(input()) +if N[0] == "9" or N[1] == "9":