| IV DCC CODE CUP |
|---|
| Finished |
Luis Higino has just returned from a long trip to Campinas, Brazil. During his stay, he visited the Institute of Computing at the University of Campinas (Unicamp) and was struck by this wall:

He liked it so much that he decided to recreate the artwork at home! He hired Cláudio to print four stickers:
Treat the box's outline as having negligible thickness. Represent each text sticker by its bounding box, the smallest rectangle containing the text. The dimensions are shown below.

The box has height $$$a_1$$$ and width $$$l_1$$$; THINK has height $$$a_2$$$ and width $$$l_2$$$; THE BOX has height $$$a_3$$$ and width $$$l_3$$$; and OUTSIDE has height $$$a_4$$$ and width $$$l_4$$$. The dashed lines show the text bounding boxes.
Luis's wall has height $$$a_p$$$ and width $$$l_p$$$. The arrangement must satisfy these conditions:
Boundaries may touch. Subject to these rules, the stickers may be placed anywhere. Given the dimensions of the four stickers and the wall, determine whether Luis can recreate the artwork.
The input consists of five lines, each containing two integers representing a height and a width:
Print SIM (Portuguese for "yes") if the artwork fits on Luis's wall, or NAO ("no") otherwise.
10 104 54 42 613 10
SIM
5 53 43 32 68 6
NAO
6 53 53 42 59 5
SIM
Explanation for example 1
In the first example, the THINK and THE BOX stickers can be placed side by side inside the box, with the box above the OUTSIDE sticker on the wall. Everything fits without overlapping interiors, so the answer is SIM.
| Name |
|---|


