use std::collections::HashSet; fn main() { let mut buf = String::new(); std::io::stdin().read_line(&mut buf).ok(); let t: usize = buf.trim().parse::().unwrap(); for _ in 0..t { buf.clear(); std::io::stdin().read_line(&mut buf).ok(); let n: usize = buf.trim().parse::().unwrap(); buf.clear(); std::io::stdin().read_line(&mut buf).ok(); let a: Vec = buf.trim().split(' ').map(|x|x.parse::().unwrap()).collect::>(); let mut x = vec![0;n+1]; let mut y = vec![0;n+1]; for i in 1..=n { x[i] = x[i-1]; y[i] = y[i-1]; if i & 1 == 0 { x[i] += a[i-1]; } else { y[i] += a[i-1]; } } let mut oc = HashSet::new(); let mut f = true; for i in 0..=n { if oc.contains(&(x[i] - y[i])) { println!("YES"); f = false; break; } else { oc.insert(x[i] - y[i]); } } if f { println!("NO"); } } }