a = {io.read("*n", "*n", "*n")} b = {io.read("*n", "*n", "*n")} function check() f = (a[1] < a[2] and a[3] < a[2]) or (a[2] < a[1] and a[2] < a[3]) g = (b[1] < b[2] and b[3] < b[2]) or (b[2] < b[1] and b[2] < b[3]) if f and g then print("Yes") os.exit() end end for i = 1, 3 do for j = 1, 3 do a[i], b[j] = b[j], a[i] check() a[i], b[j] = b[j], a[i] end end print("No")