import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines N = readline().rstrip() if len(set(N)) == 1 and N[0] == '9': print('Yes') else: print('No')