# Watermelon SOLUTION WATMELON

Page Contents

### Watermelon SOLUTION WATMELON

You have a sequence of integers [Math Processing Error]. You may perform any number of operations on this sequence (including zero). In one operation, you should choose a valid index [Math Processing Error] and decrease [Math Processing Error] by [Math Processing Error]. Can you make the sequence good using these operations?

Input
The first line of the input contains a single integer [Math Processing Error] denoting the number of test cases. The description of [Math Processing Error] test cases follows.
The first line of each test case contains a single integer [Math Processing Error].
The second line contains [Math Processing Error] space-separated integers [Math Processing Error].
Output
For each test case, print a single line containing the string “YES” if it is possible to make the given sequence good or “NO” if it is impossible.

Constraints
[Math Processing Error]
[Math Processing Error]
[Math Processing Error] for each valid [Math Processing Error]
Subtask #1 (10 points): [Math Processing Error]
Subtask #2 (30 points): [Math Processing Error]
Subtask #3 (60 points): original constraints

Example Input
2
1
-1
2
1 2
Example Output
NO
YES
Explanation
Example case 2: We can perform two operations ― subtract [Math Processing Error] from [Math Processing Error] and [Math Processing Error] from [Math Processing Error].