for i in range(input()): n=input() a=sum(map(int,raw_input().split())) print "Yes" if a%3==0 else "No"