Chika has a grid of integers. She wishes to verify if this grid is arithmetic.
A grid is arithmetic if each row and each column forms an arithmetic sequence.
Constraints
Input Specification
The first line contains a single positive integer, , representing the number of test cases. test cases follow.
Each test case consists of three space-separated integers, the values. The first line contains the integers in the three columns of the first row in order. The second line contains the integers in the three columns of the second row in order. The third line contains the integers in the three columns of the third row in order.
Output Specification
Output lines. On line , output YES
if the th square is arithmetic.
Otherwise, output NO
.
Sample Input
2
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 2
Sample Output
YES
NO
Comments