import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines S = read() answer = 'YES' if S.find(b'575') >= 0 else 'NO' print(answer)