fn input_line() -> Vec { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim() .split_whitespace() .map(|x| x.parse().ok().unwrap()) .collect() } fn main() { let mut a = input_line::(); let mut b = input_line::(); for i in 0..3 { for j in 0..3 { std::mem::swap(&mut a[i], &mut b[j]); if check(&a) && check(&b) { println!("Yes"); return; } else { std::mem::swap(&mut a[i], &mut b[j]); } } } println!("No"); } fn check(a: &Vec) -> bool { ((a[0] < a[1] && a[1] > a[2]) || (a[0] > a[1] && a[1] < a[2])) && (a[0] != a[1] && a[1] != a[2] && a[0] != a[2]) }