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 { ok &= a[i] == i + 1; } ok &= a[n * 2 - 1] == n; let mut oo1 = true; let mut oo2 = true; for i in n..n * 2 - 1 { oo1 &= a[i] == i + 1 - n; } for i in n..n * 2 - 1 { oo2 &= a[i] == n * 2 - i - 1; } if ok && (oo1 || oo2) { println!("Yes") } else { println!("No") } } }