import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int five = 0;
			int seve = 0;
			for (int i = 0; i < chr.length; i++) {
				if (Integer.parseInt(chr[i]) == 5) {
					five++;
				} else if (Integer.parseInt(chr[i]) == 7) {
					seve++;
				} else {
					break;
				}
			}
			if (five == 2 && seve == 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int five = 0;
			int seve = 0;
			for (int i = 0; i < chr.length; i++) {
				if (Integer.parseInt(chr[i]) == 5) {
					five++;
				} else if (Integer.parseInt(chr[i]) == 7) {
					seve++;
				} else {
					break;
				}
			}
			if (five == 2 && seve == 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}
} Main public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int five = 0;
			int seve = 0;
			for (int i = 0; i < chr.length; i++) {
				if (Integer.parseInt(chr[i]) == 5) {
					five++;
				} else if (Integer.parseInt(chr[i]) == 7) {
					seve++;
				} else {
					break;
				}
			}
			if (five == 2 && seve == 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	} main {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int five = 0;
			int seve = 0;
			for (int i = 0; i < chr.length; i++) {
				if (Integer.parseInt(chr[i]) == 5) {
					five++;
				} else if (Integer.parseInt(chr[i]) == 7) {
					seve++;
				} else {
					break;
				}
			}
			if (five == 2 && seve == 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	} try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int five = 0;
			int seve = 0;
			for (int i = 0; i < chr.length; i++) {
				if (Integer.parseInt(chr[i]) == 5) {
					five++;
				} else if (Integer.parseInt(chr[i]) == 7) {
					seve++;
				} else {
					break;
				}
			}
			if (five == 2 && seve == 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		} {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int five = 0;
			int seve = 0;
			for (int i = 0; i < chr.length; i++) {
				if (Integer.parseInt(chr[i]) == 5) {
					five++;
				} else if (Integer.parseInt(chr[i]) == 7) {
					seve++;
				} else {
					break;
				}
			}
			if (five == 2 && seve == 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		} BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in)) new BufferedReader(
				new InputStreamReader(System.in)) String in = br.readLine(); in br.readLine() br.readLine br String chr[] = in.split(" "); chr in.split(" ") in.split in " " int five = 0; five 0 int seve = 0; seve 0 for (int i = 0; i < chr.length; i++) {
				if (Integer.parseInt(chr[i]) == 5) {
					five++;
				} else if (Integer.parseInt(chr[i]) == 7) {
					seve++;
				} else {
					break;
				}
			} int i = 0; int i = 0; i 0 i < chr.length i chr.length chr chr.length i++ i++ i {
				if (Integer.parseInt(chr[i]) == 5) {
					five++;
				} else if (Integer.parseInt(chr[i]) == 7) {
					seve++;
				} else {
					break;
				}
			} {
				if (Integer.parseInt(chr[i]) == 5) {
					five++;
				} else if (Integer.parseInt(chr[i]) == 7) {
					seve++;
				} else {
					break;
				}
			} if (Integer.parseInt(chr[i]) == 5) {
					five++;
				} else if (Integer.parseInt(chr[i]) == 7) {
					seve++;
				} else {
					break;
				} Integer.parseInt(chr[i]) == 5 Integer.parseInt(chr[i]) Integer.parseInt Integer chr[i] chr i 5 {
					five++;
				} five++ five if (Integer.parseInt(chr[i]) == 7) {
					seve++;
				} else {
					break;
				} Integer.parseInt(chr[i]) == 7 Integer.parseInt(chr[i]) Integer.parseInt Integer chr[i] chr i 7 {
					seve++;
				} seve++ seve {
					break;
				} break; if (five == 2 && seve == 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			} five == 2 && seve == 1 five == 2 five 2 seve == 1 seve 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" String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int five = 0;
			int seve = 0;
			for (int i = 0; i < chr.length; i++) {
				if (Integer.parseInt(chr[i]) == 5) {
					five++;
				} else if (Integer.parseInt(chr[i]) == 7) {
					seve++;
				} else {
					break;
				}
			}
			if (five == 2 && seve == 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int five = 0;
			int seve = 0;
			for (int i = 0; i < chr.length; i++) {
				if (Integer.parseInt(chr[i]) == 5) {
					five++;
				} else if (Integer.parseInt(chr[i]) == 7) {
					seve++;
				} else {
					break;
				}
			}
			if (five == 2 && seve == 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int five = 0;
			int seve = 0;
			for (int i = 0; i < chr.length; i++) {
				if (Integer.parseInt(chr[i]) == 5) {
					five++;
				} else if (Integer.parseInt(chr[i]) == 7) {
					seve++;
				} else {
					break;
				}
			}
			if (five == 2 && seve == 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}
}