#abc274d. [abc274_d]Robot Arms 2
[abc274_d]Robot Arms 2
Problem Statement
You are given a sequence of length consisting of positive integers, and integers and .
Determine whether it is possible to place points in the -coordinate plane to satisfy all of the following conditions. (It is allowed to place two or more points at the same coordinates.)
- .
- .
- .
- The distance between the points and is . ()
- The segments and form a degree angle. ()
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
If it is possible to place to satisfy all of the conditions in the Problem Statement, print Yes
; otherwise, print No
.
Sample Input 1
3 -1 1
2 1 3
Sample Output 1
Yes
The figure below shows a placement where , , , and . All conditions in the Problem Statement are satisfied.
Sample Input 2
5 2 0
2 2 2 2 2
Sample Output 2
Yes
Letting , , , , , and satisfies all the conditions. Note that multiple points may be placed at the same coordinates.
Sample Input 3
4 5 5
1 2 3 4
Sample Output 3
No
Sample Input 4
3 2 7
2 7 4
Sample Output 4
No
Sample Input 5
10 8 -7
6 10 4 1 5 9 8 6 5 1
Sample Output 5
Yes