Oxymoron#4376

Oxymoron

1 second
122.486 megabytes
Medium

Three square matrices of the same size are provided. Your task is to determine if the third matrix is the result of multiplying the first matrix by the second matrix, in that specific order.

Input

The input consists of multiple test cases. Each test case starts with an integer (1 \leq n \leq 500), which represents the size of the matrices. This is followed by the details of three matrices, each consisting of rows with integers per row. All integers in the input are no greater than 10^9 by absolute value. The input concludes with a test case where n = 0, which should not be processed.

Output

For each test case, output YES if the third matrix is the product of the first and second matrices. Otherwise, output NO.

Examples

Example 1

Loading
Loading