#include #define fore(x,a,b) for(int x=a, qwert=b; x> T; while(T--){ int n; cin >> n; int s=0; fore(x,0,n){ int tmp; cin >> tmp; while(tmp)s+=tmp%10, s%=3, tmp/=10; } cout << (s == 0 ? "Yes" : "No") << "\n"; } }