

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);


        String input = in.nextLine();
        input=input.replaceAll(" ","");
        if (input.matches("557")||input.matches("755")||input.matches("575")) System.out.println("YES");
        else System.out.println("NO");

    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);


        String input = in.nextLine();
        input=input.replaceAll(" ","");
        if (input.matches("557")||input.matches("755")||input.matches("575")) System.out.println("YES");
        else System.out.println("NO");

    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);


        String input = in.nextLine();
        input=input.replaceAll(" ","");
        if (input.matches("557")||input.matches("755")||input.matches("575")) System.out.println("YES");
        else System.out.println("NO");

    } main {
        Scanner in = new Scanner(System.in);


        String input = in.nextLine();
        input=input.replaceAll(" ","");
        if (input.matches("557")||input.matches("755")||input.matches("575")) System.out.println("YES");
        else System.out.println("NO");

    } Scanner in = new Scanner(System.in); in new Scanner(System.in) String input = in.nextLine(); input in.nextLine() in.nextLine in input=input.replaceAll(" ","") input input.replaceAll(" ","") input.replaceAll input " " "" if (input.matches("557")||input.matches("755")||input.matches("575")) System.out.println("YES");
        else System.out.println("NO"); input.matches("557")||input.matches("755")||input.matches("575") input.matches("557")||input.matches("755")||input.matches("575") input.matches("557") input.matches input "557" input.matches("755") input.matches input "755" input.matches("575") input.matches input "575" System.out.println("YES") System.out.println System.out System System.out "YES" System.out.println("NO") System.out.println System.out System System.out "NO" String[] args args public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);


        String input = in.nextLine();
        input=input.replaceAll(" ","");
        if (input.matches("557")||input.matches("755")||input.matches("575")) System.out.println("YES");
        else System.out.println("NO");

    }
} public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);


        String input = in.nextLine();
        input=input.replaceAll(" ","");
        if (input.matches("557")||input.matches("755")||input.matches("575")) System.out.println("YES");
        else System.out.println("NO");

    }
} Main


import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);


        String input = in.nextLine();
        input=input.replaceAll(" ","");
        if (input.matches("557")||input.matches("755")||input.matches("575")) System.out.println("YES");
        else System.out.println("NO");

    }
}
