import strutils
let S = readLine stdin
["YES", "NO"][int(S.find("575") == -1)].echo