use std::io::Read; fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let v: Vec = s.split_whitespace().flat_map(str::parse).collect(); println!( "{}", if v[1] < v[2] && v[1] < v[3] || v[1] > v[2] && v[1] > v[3] { "Yes" } else { "No" } ) }