#include #include #include #include #include #include #include char* canConstruct(int a_size, int* a) { // Return "Yes" or "No" denoting whether you can construct the required number. int i,sum=0; for(i=0;i< a_size;i++) { sum = sum + a[i]; } if(sum % 3 == 0) { return "Yes"; } else return "No"; } int main() { int t; scanf("%i", &t); for(int a0 = 0; a0 < t; a0++){ int n; scanf("%i", &n); int *a = malloc(sizeof(int) * n); for (int a_i = 0; a_i < n; a_i++) { scanf("%i",&a[a_i]); } int result_size; char* result = canConstruct(n, a); printf("%s\n", result); } return 0; }