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