Ten teams play a complete round-robin tournament. Every pair of distinct teams plays exactly once, so each team plays 9 matches and there are 45 matches in total.
In each match, the winner receives 3 points, both teams receive 1 point in a draw, and the loser receives 0 points.
After the tournament, only the final scores of the ten teams remain. Determine whether there exists an assignment of results to all 45 matches that produces exactly these scores.
Input
The input is given from Standard Input in the following format:
Each case is given in the following format:
Output
For each test case, print YES if the given scores can be realized by some set of match results, and print NO otherwise.
Constraints
- .
- ().
- All values in the input are integers.
Subtasks
Samples
Input
5
9 9 9 9 9 9 9 9 9 9
3 6 9 12 15 18 21 24 27 0
27 27 0 0 0 0 0 0 0 0
13 13 13 13 13 13 13 13 13 13
12 11 10 9 8 7 6 5 4 3
Output
YES
YES
NO
YES
NO