# Programming contests

## DEIK Regionális Programozó Csapatverseny, középiskolai kategória, 2016. december 4.

December 4, 2016 10:10 AM – December 4, 2016 3:10 PM

# Triangle

Determine if it is possible to produce two triangles of given side lengths, by cutting some rectangle with a single line segment.

## Input Specification

The 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 Specification

Print 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`”.

## Sample Input 1

1. `3 4 5`
2. `4 3 5`

## Output for Sample Input 1

1. `YES`

## Sample Input 2

1. `3 4 6`
2. `4 6 3`

## Output for Sample Input 2

1. `NO`
1. `39 52 65`
2. `25 60 65`
1. `NO`