public class Main{ public static void main(String[] args){ String line = new java.util.Scanner(System.in).next(); if(line.indexOf("575") == -1)System.out.println("NO"); else System.out.println("YES"); } }