#[macro_export] macro_rules! setup { { mut $input:ident: SplitWhitespace $(,)? } => { use std::io::Read; let mut buf = String::new(); std::io::stdin().read_to_string(&mut buf).ok(); let mut $input = buf.split_whitespace(); }; } #[macro_export] macro_rules! parse_next { ($str_iter:expr) => { $str_iter.next().unwrap().parse().ok().unwrap() }; } #[allow(unused_imports)] use std::collections::{HashMap, HashSet, VecDeque}; fn main() { setup! { mut input: SplitWhitespace }; let h: usize = parse_next!(input); let w: usize = parse_next!(input); let n: (usize, usize) = (parse_next!(input), parse_next!(input)); let z: (usize, usize) = (parse_next!(input), parse_next!(input)); let ans = match (|| { if z == (1, 1) { if n == (1, 2) { return true; } if n == (3, 2) { return true; } if n == (2, 1) { return true; } if n == (2, 3) { return true; } } if z == (1, w) { if n == (1, w - 1) { return true; } if n == (3, w - 1) { return true; } if n == (2, w - 2) { return true; } if n == (2, w) { return true; } } if z == (h, 1) { if n == (h - 2, 2) { return true; } if n == (h, 2) { return true; } if n == (h - 1, 1) { return true; } if n == (h - 1, 3) { return true; } } if z == (h, w) { if n == (h - 2, w - 1) { return true; } if n == (h, w - 1) { return true; } if n == (h - 1, w - 2) { return true; } if n == (h - 1, w) { return true; } } return false; })() { true => "Yes", false => "No", }; println!("{}", ans); }