import java.util.Scanner;

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

	public void exec(Scanner sc) {
		String s = "575";
		s = s.replaceFirst(sc.next(), "");
		s = s.replaceFirst(sc.next(), "");
		s = s.replaceFirst(sc.next(), "");
		System.out.println(s.length() == 0 ? "YES" : "NO");
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			new Main().exec(sc);
		}
	}

	public void exec(Scanner sc) {
		String s = "575";
		s = s.replaceFirst(sc.next(), "");
		s = s.replaceFirst(sc.next(), "");
		s = s.replaceFirst(sc.next(), "");
		System.out.println(s.length() == 0 ? "YES" : "NO");
	}
} Main public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			new Main().exec(sc);
		}
	} main {
		try (Scanner sc = new Scanner(System.in)) {
			new Main().exec(sc);
		}
	} try (Scanner sc = new Scanner(System.in)) {
			new Main().exec(sc);
		} {
			new Main().exec(sc);
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) new Main().exec(sc) new Main().exec new Main() sc String[] args args public void exec(Scanner sc) {
		String s = "575";
		s = s.replaceFirst(sc.next(), "");
		s = s.replaceFirst(sc.next(), "");
		s = s.replaceFirst(sc.next(), "");
		System.out.println(s.length() == 0 ? "YES" : "NO");
	} exec {
		String s = "575";
		s = s.replaceFirst(sc.next(), "");
		s = s.replaceFirst(sc.next(), "");
		s = s.replaceFirst(sc.next(), "");
		System.out.println(s.length() == 0 ? "YES" : "NO");
	} String s = "575"; s "575" s = s.replaceFirst(sc.next(), "") s s.replaceFirst(sc.next(), "") s.replaceFirst s sc.next() sc.next sc "" s = s.replaceFirst(sc.next(), "") s s.replaceFirst(sc.next(), "") s.replaceFirst s sc.next() sc.next sc "" s = s.replaceFirst(sc.next(), "") s s.replaceFirst(sc.next(), "") s.replaceFirst s sc.next() sc.next sc "" System.out.println(s.length() == 0 ? "YES" : "NO") System.out.println System.out System System.out s.length() == 0 ? "YES" : "NO" s.length() == 0 s.length() s.length s 0 "YES" "NO" Scanner sc sc public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			new Main().exec(sc);
		}
	}

	public void exec(Scanner sc) {
		String s = "575";
		s = s.replaceFirst(sc.next(), "");
		s = s.replaceFirst(sc.next(), "");
		s = s.replaceFirst(sc.next(), "");
		System.out.println(s.length() == 0 ? "YES" : "NO");
	}
} public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			new Main().exec(sc);
		}
	}

	public void exec(Scanner sc) {
		String s = "575";
		s = s.replaceFirst(sc.next(), "");
		s = s.replaceFirst(sc.next(), "");
		s = s.replaceFirst(sc.next(), "");
		System.out.println(s.length() == 0 ? "YES" : "NO");
	}
} Main
import java.util.Scanner;

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

	public void exec(Scanner sc) {
		String s = "575";
		s = s.replaceFirst(sc.next(), "");
		s = s.replaceFirst(sc.next(), "");
		s = s.replaceFirst(sc.next(), "");
		System.out.println(s.length() == 0 ? "YES" : "NO");
	}
}
