print((input().count("9")and"Yes"or"No"))
print(("YNeos"[input().count("9")<1::2]))
print((input().count("9") and "Yes" or "No"))

print(("YNeos"[input().count("9") < 1 :: 2]))

-print((input().count("9") and "Yes" or "No")) +print(("YNeos"[input().count("9") < 1 :: 2]))