using System; public class Hello { public static int[] a, b; static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); a = Array.ConvertAll(line, int.Parse); line = Console.ReadLine().Trim().Split(' '); b = Array.ConvertAll(line, int.Parse); getAns(); } static void getAns() { for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) { swap(i, j); if (check(a) && check(b)) { Console.WriteLine("Yes"); return; } swap(i, j); } Console.WriteLine("No"); } static void swap(int i, int j) { var w = a[i]; a[i] = b[j]; b[j] = w; } static bool check(int[] a) { if (!(a[0] != a[1] && a[1] != a[2] && a[0] != a[2])) return false; if (a[1] > a[0] && a[1] > a[2]) return true; if (a[1] < a[0] && a[1] < a[2]) return true; return false; } }