for _ in range(int(input())): input() no = [int(x) for x in input().split()] if sum(no) % 3 is 0: print("Yes") else:print("No")