use itertools::Itertools; use proconio::input; fn main() { input! { q: usize, } let output = (0..q) .map(|_| if solve() { "Yes" } else { "No" }) .join("\n"); println!("{output}"); } fn solve() -> bool { input! { s: String, t: String, } fn to_pair(s: &str) -> (String, String) { let s0 = s.chars().step_by(2).sorted_unstable().collect(); let s1 = s[1..].chars().step_by(2).sorted_unstable().collect(); (s0, s1) } to_pair(&s) == to_pair(&t) }