Square
Hard
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Three rectangles are provided.
Your task is to determine if it's possible to arrange these rectangles to form a square. The rectangles must not overlap, but they can be repositioned without altering their original orientation.
Input
The input consists of three lines, each describing one rectangle. Each line contains two integers w and h, separated by a space (0 < w, h ≤ 10^6), representing the width and height of the rectangle, respectively.
Output
Print YES if such a square can be formed, otherwise print NO.
Examples
Input #1
Answer #1
Submissions 396
Acceptance rate 8%