cho.sh
Notes
Loading...

Candy Teacher Go Changyoung

Time limit

1s

Memory limit

128 MB

Problem

Go Changyoung, once a candy researcher, left the factory and became an elementary school teacher.

On picnic day, each of the N students in his class brought candies in their bag. Some students who brought many candies began teasing students who brought fewer candies, so Changyoung decided to gather all the candies and redistribute them equally.

Determine whether every student can receive the same number of candies.

Input

The first line contains the number of test cases T. Blank lines may appear between test cases.

For each test case, the first line contains the number of students N. The next N lines each contain the number of candies brought by one student.

N is a positive integer at most 100,000. Each candy count is an integer from 0 to 10^18, inclusive. The total number of candies in one test case may exceed 10^18.

Output

For each test case, print YES if the candies can be distributed so that every student receives the same number; otherwise, print NO.