It is September 9 in Japan now.  You are given a two-digit integer N. Answer the question: Is 9 contained in the decimal notation of N?
day = input()

if day[0] == '9' or day[1] == '9':
    print('YES')
else:
    print('NO')
day = input()

if int(day[0] )== 9 or int(day[1]) == 9:
    print('Yes')
else:
    print('No')