#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; void solve(){ ll N, S=0, A, a, b, c; cin >> N; multiset st;; for (int i=0; i> A; S += A; st.insert(A); } if (S % 3 != 0){ cout << "No" << endl; return; } while(st.size() >= 3){ a = *st.rbegin(); st.erase(prev(st.end())); b = *st.rbegin(); st.erase(prev(st.end())); c = *st.rbegin(); st.erase(prev(st.end())); b -= c; if (b > 0) st.insert(b); a -= c; if (a > 0) st.insert(a); } cout << (st.size() == 0 ? "Yes" : "No") << endl; } int main(){ int T; cin >> T; while(T){ solve(); T--; } return 0; }