eolymp
bolt
Try our new interface for solving problems
Problems

Two triangles

Two triangles

Two triangles ABC and DEF are given. Determine, are they similar.

Input

First line contains the coordinates of vertices for triangle ABC: xA, yA, xB, yB, xC, yC. Second line contains the coordinates of vertices for the second triangle in the same format. All numbers are integer and do not exceed 5000 by absolute value. Both triangles have nonzero area.

Output

Print YES if the triangles are similar and NO otherwise.

Time limit 1 second
Memory limit 128 MiB
Input example #1
0 0 1 0 0 1
10 10 12 10 10 12
Output example #1
YES
Input example #2
0 0 1 0 0 1
0 0 10 0 0 5
Output example #2
NO
Author Fedor Tsarev