n = input() print("Yes" if len(set(n)) == 1 and n[0] == "9" else "No")