import java.util.Scanner; public class Main{ private static Scanner sc=new Scanner(System.in); public static void main(String args[])throws Exception{ String s=sc.nextLine(); if(s.indexOf("575")==-1)System.out.println("NO"); else System.out.println("YES"); } }