Nightmare Awake
Time limit1sMemory limit1024 MB
Given a circle, a line, and two points, decide whether rotating the circle can make the segment through the two points parallel to the line.
Problem
Many people play at magic rituals on Halloween. Most of them do it as a joke, but today you have come across a real magical artifact: a box with an unusual device on its lid.
You decide to open the box no matter what (although in movies this usually ends badly). The device on the lid can be seen as a plane with the following objects:
- a circle with center and radius ;
- a line given by the equation ;
- two marked points with coordinates and .
The circle can be rotated around its center. The marked points that lie on the circle rotate together with it.
You immediately realize that to open the box, the line must be parallel to the line through the two marked points. Can the circle be rotated so that these lines are parallel, or will the box stay shut forever?
Input
The first line contains three integers , , and , separated by spaces: the coordinates of the circle's center and its radius (; ).
The second line contains three integers , , and , separated by spaces: the coefficients of the line ().
The third line contains the coordinates and of the first marked point (). The fourth line contains the coordinates and of the second marked point in the same format.
Output
Print a single line containing YES if the box can be opened, and NO otherwise.