#include using namespace std; int main() { int t; cin >> t; for(int a0 = 0; a0 < t; a0++){ int n; cin >> n; int temp,sum=0,k; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> temp; while(temp){ sum=sum+(temp%10); temp=temp/10; } } if(sum%3==0){ cout<<"Yes"<