eolymp
bolt
Try our new interface for solving problems
Problems

Triangle

Triangle

prb8184.gif Determine if it is possible to produce two triangles of given side lengths, by cutting some rectangle with a single line segment, and freely rotating and flipping the resulting pieces.

Input

Consists of two lines. The first line contains three space-separated positive integers, indicating the desired side lengths of the first triangle. Similarly, the second line contains three space-separated positive integers, denoting the desired side lengths of the second triangle. It is guaranteed that the side lengths produce valid triangles. All side lengths are less than or equal to 100.

Output

Print, on a single line, whether there exists a rectangle which could have been cut to form triangles of the given side lengths. If such a rectangle exists, print YES. Otherwise, print NO.

Time limit 1 second
Memory limit 128 MiB
Input example #1
3 4 5
4 3 5
Output example #1
YES
Input example #3
39 52 65
25 60 65
Output example #3
NO
Source 2015 ACM North America - Pacific Northwest, Division 1, Problem D