n = eval(input())





if n[0] == '9' or n[1] == '9':

        print("Yes")

else:

        print("No")

n = input()

if '9' in n:

	print('Yes')

else:

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

n = input()
if "9" in n:
    print("Yes")
else:
    print("No")

-n = eval(input()) -if n[0] == "9" or n[1] == "9": +n = input() +if "9" in n: