# Matrix product

# Matrix product

**In the forest, Countess Mordvinovoj. Peterhof. ****1891.**Over the years the artist has developed an acute color vision. Now he can see and transfer brush variability of colors depending on lighting and reflections from nearby objects. Painter writes smooth transitions of green, yellow and grayish shades barrel oil, pine needles and moss. But the subtle coloristic changes are not an end in itself for the artist: he wants them to convey to the viewer's real-life nature. The picture makes the viewer the impression that it is within the forest area, gives to experience the surrounding atmosphere pine thicket.

Given three square matrices **A**, **B**, **C**, each of which has size **n** x **n**. Must verify that: **A** х **B** = **C**.

** Input**

Each test starts the value of **n** (**n** ≤ **500**). Followed by three matrices **A**, **B**, **C**, each of which is **n** rows containing exactly **n** numbers. Elements of the matrices **A** and **B** modulo do not exceed **1000**. The final test includes **n** = **0** and not processed. For example, in the first test should verify that

** Output**

For each test, a single line display "**YES**" or "**NO**" depending on whether the equation **A** x **B** = **C** or not.

2 1 2 3 4 1 3 2 3 5 9 11 21 2 1 2 3 4 1 3 2 3 5 9 10 21 0

YES NO