import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int[] a = new int[3]; for (int i = 0; i < 3; i++) { a[i] = sc.nextInt(); } int[] b = new int[3]; for (int i = 0; i < 3; i++) { b[i] = sc.nextInt(); } sc.close(); if (check(a) && check(b)) { System.out.println("Yes"); return; } for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { int t = a[i]; a[i] = b[j]; b[j] = t; if (check(a) && check(b)) { System.out.println("Yes"); return; } t = a[i]; a[i] = b[j]; b[j] = t; } } System.out.println("No"); } static boolean check(int[] a) { if (a[0] != a[2]) { if (a[0] < a[1] && a[1] > a[2]) return true; if (a[0] > a[1] && a[1] < a[2]) return true; } return false; } }