let a = readLine()!.split(separator: " ").map{Int($0)!} let b = readLine()!.split(separator: " ").map{Int($0)!} var z = true for i in 0...2{ for j in 0...2{ var c = a var d = b (c[i],d[j]) = (d[j],c[i]) if Set(c).count != c.count{continue} if Set(d).count != d.count{continue} if (c.max() == c[1]) || (c.min() == c[1]){ if (d.max() == d[1]) || (d.min() == d[1]){ z = false } } //print(c,d) } } print(z ? "No" : "Yes")