t = int(input()) for _ in range(t): n = int(input()) if sum(int(a) for a in input().split())%3 == 0: print('Yes') else: print('No')