using System; namespace yukicoder { class Program { static void Main(string[] args) { string s = Console.ReadLine(); bool f = false; bool f1 = false; int count = 0; for(int i = 0; i < s.Length; i++) { string b = s.Substring(i,1); if (f == false && b == "5") { f = true; } else if (f == true && b == "7") { f1 = true; count++; } else if (f1 == true && b == "5"&&count==1) { Console.WriteLine("YES"); break; } else { f = false; } if (i == s.Length - 1) { Console.WriteLine("NO"); } } } } }