S = input() if S.find('575') != -1: print('YES') else: print('NO')