D. MA141
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

A professor of analytic geometry (MA141) is worried because he can only think of homothety problems to put on his second exam (P2). Therefore, he threatens a turtle from IMECC to get an easy problem.

The turtle, afraid of losing its head by being swallowed, suggests the following problem: "Given four points in the Cartesian plane $$$A, B, C, D$$$. The task is to determine whether these four points form a square with sides $$$AB$$$, $$$BC$$$, $$$CD$$$, and $$$DA$$$."

The professor gladly accepted the turtle's suggestion, and everyone lived happily ever after.

Input

The input consists of four lines, each containing two integers separated by a space $$$x$$$ and $$$y\;(-10^4 \leq x, y \leq 10^4)$$$, representing the coordinates of points $$$A, B, C$$$, and $$$D$$$. It is guaranteed that there are no coincident points among $$$A$$$, $$$B$$$, $$$C$$$, and $$$D$$$.

Output

Print "SIM" (portuguese for YES) if the four points form a square with sides $$$AB$$$, $$$BC$$$, $$$CD$$$, and $$$DA$$$, and "NAO" (portuguese for NO) otherwise.

Examples
Input
0 0
0 1
1 1
1 0
Output
SIM
Input
1 0
1 1
0 1
0 0
Output
SIM
Input
0 0
0 1
1 2
1 1
Output
NAO
Input
1 0
2 1
1 2
0 1
Output
SIM
Input
1 0
1 2
2 1
0 1
Output
NAO
Note

Note that the sides of the square do not need to be parallel to the axes, as shown in the fourth example.

Hint: Floating point operations may cause precision errors. Try to do everything with integers.