fn solve() -> String { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut a = String::new(); std::io::stdin().read_line(&mut a).ok(); let mut a: Vec = a.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let summary = a.iter().sum::(); if summary % 3 > 0 { return "No".to_string(); } let maxval = *a.iter().max().unwrap(); if maxval > summary / 3 { "No".to_string() } else { "Yes".to_string() } } fn main() { let mut t = String::new(); std::io::stdin().read_line(&mut t).ok(); let t: usize = t.trim().parse().unwrap(); let mut result = Vec::with_capacity(t); for _ in 0..t { result.push(solve()); } for v in result.iter() { println!("{}", v); } }