def solve(): s = input() for i in range(len(s)): if (i + 2 >= len(s)): print("NO") return if (s[i] == "5" and s[i + 1] == "7" and s[i + 2] == "5"): print("YES") return print("NO") solve()