Start

2019-02-04 13:00 UTC

Kattis Set 04

End

2019-02-11 09:29 UTC
The end is near!
Contest is over.
Not yet started.
Contest is starting in -281 days 20:36:02

Time elapsed

164:29:59

Time remaining

0:00:00

Problem H
Square Deal

Given the dimensions of three rectangles, determine if all three can be glued together, touching just on the edges, to form a square. You may rotate the rectangles. For example, Figure 1 shows successful constructions for the first two sample inputs.

\includegraphics[scale=0.6]{sample1.png}
(1.a)
  
\includegraphics[scale=0.6]{sample2.png}
(1.b)
Figure 1: Constructions for the first two examples

Input

The input consists of three lines, with line $j$ containing integers $H_ j$ and $W_ j$, designating the height and width of a rectangle, such that $100 \geq H_ j \geq W_ j \geq 1$, and such that $H_1 \geq H_2 \geq H_3$.

Output

Output a line saying YES if they can be glued together to form a square. Output NO otherwise.

Sample Input 1 Sample Output 1
7 3
7 1
7 3
YES
Sample Input 2 Sample Output 2
9 2
7 4
7 5
YES
Sample Input 3 Sample Output 3
3 1
3 2
3 3
NO