시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 15 11 11 73.333%

문제

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 C.1 shows successful constructions for the first two sample inputs.

Figure C.1: Constructions for the first two examples

입력

The input consists of three lines, with line j containing integers Hj and Wj , designating the height and width of a rectangle, such that 100 ≥ Hj ≥ Wj ≥ 1, and such that H1 ≥ H2 ≥ H3.

출력

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

예제 입력 1

7 3
7 1
7 3

예제 출력 1

YES

예제 입력 2

9 2
7 4
7 5

예제 출력 2

YES

예제 입력 3

3 1
3 2
3 3

예제 출력 3

NO