#include #include #include #include #include #include #include char* canConstruct(int a_size, int a) { int remainder,rev; while(a != 0) { remainder = a%10; rev = rev*10 + remainder; a /= 10; }if(rev%3==0) printf("Yes"); else printf("No"); return; } int main() { int t; scanf("%d", &t); for(int a0 = 0; a0 < t; a0++){ int n; scanf("%d", &n); int *a = malloc(sizeof(int) * n); for (int a_i = 0; a_i < n; a_i++) { scanf("%d",&a[a_i]); } int result_size; char* result = canConstruct(n, a); printf("%s\n", result); } return 0; }