#include std::string canConstruct(int arr[], int size) { int sum, i; for (i = 0, sum = 0; i < size; ++i) { sum += arr[i]; } if (sum % 3 == 0) { return "Yes\n"; } else { return "No\n"; } } int main() { int num_of_query, i, *arr, j, size; std::cin >> num_of_query; std::string st[num_of_query]; for (i = 0; i < num_of_query; ++i) { std::cin >> size; arr = new int[size]; for (j = 0; j < size; ++j) { std::cin >> arr[j]; } st[i] = canConstruct(arr, size); delete [] arr; } for (i = 0; i < num_of_query; ++i) { std::cout << st[i]; } return 0; }