s = input()
t = "575"
if t in s:
    print("YES")
else:
    print("NO")