import java.util.Scanner; public class HelloWorld { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int[] arr1 = new int[3]; int[] arr2 = new int[3]; for (int i = 0 ; i < 3; i ++) { arr1[i] = sc.nextInt(); } for (int i = 0 ; i < 3; i ++) { arr2[i] = sc.nextInt(); } sc.close(); boolean flag = false; for (int i = 0; i < 3; i ++) { if (flag == true) {break;} for (int j = 0; j < 3; j ++) { int temp = 0; temp = arr1[i]; arr1[i] = arr2[j]; arr2[j] = temp; if (is_matsu(arr1) && is_matsu(arr2)) { flag = true; break; } temp = arr1[i]; arr1[i] = arr2[j]; arr2[j] = temp; } } System.out.println(flag ? "Yes" : "No"); } static boolean is_matsu(int[] arr) { return (arr[0] < arr[1] && arr[2] < arr[1] && arr[0] != arr[2]) || (arr[0] > arr[1] && arr[2] > arr[1] && arr[0] != arr[2]); } }