Triangle

Decide whether two given integer-sided triangles are congruent right triangles that can form a rectangle split along its diagonal.

Medium4GeometryMathSortingNo attempts yetTime limit2sMemory limit256 MB

Problem

You cut one rectangular sheet of paper into two pieces with a single straight line segment. You may then rotate and flip each piece freely.

Given the three side lengths of two triangles, decide whether the two pieces can be exactly those triangles. In other words, decide whether some rectangle exists such that one straight cut leaves two pieces matching the two given triangles. The side lengths of the rectangle do not have to be integers.

Input

The input has two lines. The first line contains the three side lengths of the first triangle, separated by spaces. The second line contains the three side lengths of the second triangle in the same format.

Every side length is a positive integer of at most 100100, and the three numbers on each line always form a triangle.

Output

Print YES on the first line if such a rectangle exists, and NO otherwise.