import java.util.Scanner;

public class Main{
	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String str = scanner.nextLine();
		String[] strs = str.split("");

		int five = 0;
		int seven = 0;

		for(String s: strs) {
			if(s.equals("5")) {
				five += 1;
			}else if(s.equals("7")) {
				seven += 1;
			}
		}

		if(five == 2 && seven == 1) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}

		scanner.close();
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String str = scanner.nextLine();
		String[] strs = str.split("");

		int five = 0;
		int seven = 0;

		for(String s: strs) {
			if(s.equals("5")) {
				five += 1;
			}else if(s.equals("7")) {
				seven += 1;
			}
		}

		if(five == 2 && seven == 1) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}

		scanner.close();
	}
} Main public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String str = scanner.nextLine();
		String[] strs = str.split("");

		int five = 0;
		int seven = 0;

		for(String s: strs) {
			if(s.equals("5")) {
				five += 1;
			}else if(s.equals("7")) {
				seven += 1;
			}
		}

		if(five == 2 && seven == 1) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}

		scanner.close();
	} main {

		Scanner scanner = new Scanner(System.in);

		String str = scanner.nextLine();
		String[] strs = str.split("");

		int five = 0;
		int seven = 0;

		for(String s: strs) {
			if(s.equals("5")) {
				five += 1;
			}else if(s.equals("7")) {
				seven += 1;
			}
		}

		if(five == 2 && seven == 1) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}

		scanner.close();
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String str = scanner.nextLine(); str scanner.nextLine() scanner.nextLine scanner String[] strs = str.split(""); strs str.split("") str.split str "" int five = 0; five 0 int seven = 0; seven 0 for(String s: strs) {
			if(s.equals("5")) {
				five += 1;
			}else if(s.equals("7")) {
				seven += 1;
			}
		} String s strs {
			if(s.equals("5")) {
				five += 1;
			}else if(s.equals("7")) {
				seven += 1;
			}
		} {
			if(s.equals("5")) {
				five += 1;
			}else if(s.equals("7")) {
				seven += 1;
			}
		} if(s.equals("5")) {
				five += 1;
			}else if(s.equals("7")) {
				seven += 1;
			} s.equals("5") s.equals s "5" {
				five += 1;
			} five += 1 five 1 if(s.equals("7")) {
				seven += 1;
			} s.equals("7") s.equals s "7" {
				seven += 1;
			} seven += 1 seven 1 if(five == 2 && seven == 1) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		} five == 2 && seven == 1 five == 2 five 2 seven == 1 seven 1 {
			System.out.println("YES");
		} System.out.println("YES") System.out.println System.out System System.out "YES" {
			System.out.println("NO");
		} System.out.println("NO") System.out.println System.out System System.out "NO" scanner.close() scanner.close scanner String[] args args public class Main{
	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String str = scanner.nextLine();
		String[] strs = str.split("");

		int five = 0;
		int seven = 0;

		for(String s: strs) {
			if(s.equals("5")) {
				five += 1;
			}else if(s.equals("7")) {
				seven += 1;
			}
		}

		if(five == 2 && seven == 1) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}

		scanner.close();
	}
} public class Main{
	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String str = scanner.nextLine();
		String[] strs = str.split("");

		int five = 0;
		int seven = 0;

		for(String s: strs) {
			if(s.equals("5")) {
				five += 1;
			}else if(s.equals("7")) {
				seven += 1;
			}
		}

		if(five == 2 && seven == 1) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}

		scanner.close();
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String str = scanner.nextLine();
		String[] strs = str.split("");

		int five = 0;
		int seven = 0;

		for(String s: strs) {
			if(s.equals("5")) {
				five += 1;
			}else if(s.equals("7")) {
				seven += 1;
			}
		}

		if(five == 2 && seven == 1) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}

		scanner.close();
	}
}