use std::io::*; fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let t: usize = itr.next().unwrap().parse().unwrap(); for _ in 0..t { let n: usize = itr.next().unwrap().parse().unwrap(); let a: Vec = (0..n * 2) .map(|_| itr.next().unwrap().parse().unwrap()) .collect(); let mut ok = true; for i in 0..n * 2 { let mut cnt = vec![0; n + 1]; for j in i + 1..n * 2 { if a[j] < a[i] { cnt[a[j]] += 1; } } for j in 1..=n { ok &= cnt[j] <= 1; } } if ok { println!("Yes"); } else { println!("No"); } } }