use std::io::*; use std::str::FromStr; #[allow(dead_code)] fn get_line() -> String { let stdin = stdin(); let mut line = String::new(); stdin.lock().read_line(&mut line).expect("io error."); line.trim().to_string() } #[allow(dead_code)] fn get_word() -> T { (&get_line()).parse().ok().expect("parse error.") } #[allow(dead_code)] fn get_vec() -> Vec { (&get_line()).split('.').map(|x| x.parse().ok().expect("parse error.")).collect() } fn main() { let a = get_vec::(); let b = get_vec::(); println!("{}", if comp(&a, &b) {"YES"} else {"NO"}); } fn comp(a: &Vec, b: &Vec) -> bool { for i in 0..a.len() { if a[i] != b[i] { return a[i] > b[i]; } } true }