#include using namespace std; int t,n,x; int main(){ ios::sync_with_stdio(0); cin.tie(0); cin >> t; while (t--){ cin >> n; long long tot=0; for (int i=1;i<=n;i++){ cin >> x; tot+=x; } cout << (!(tot%3)?"Yes":"No") << "\n"; } }