use proconio::input; use std::cmp::Ordering::{Equal, Greater, Less}; fn main() { input! { s: String, t: String, } let mut a = s.chars().filter_map(|c| c.to_digit(10)); let mut b = t.chars().filter_map(|c| c.to_digit(10)); for (x, y) in a.by_ref().zip(b.by_ref()) { match x.cmp(&y) { Equal => continue, Greater => { println!("YES"); return; }, Less => { println!("NO"); return; }, } } println!("YES"); }