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 mut cnt = [0i64; 26]; let a = get_line(); for c in a.chars() { let itr = ((c as u8) - ('a' as u8)) as usize; cnt[itr] += 1; } let b = get_line(); for c in b.chars() { let itr = ((c as u8) - ('a' as u8)) as usize; cnt[itr] -= 1; if cnt[itr] < 0 { println!("NO"); return; } } println!("YES"); }