#!/bin/python3 t= int(input()) while(t>0): n = int(input().strip()) arr = input() l = list(map(int,arr.split(' '))) if(sum(l)%3==0): print('Yes') else: print('No') t-=1