N. Think The Box Outside
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

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:

  1. A box (an unfilled rectangle).
  2. The word THINK.
  3. The words THE BOX, one above the other.
  4. The word OUTSIDE.

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:

  • The bounding boxes of THINK and THE BOX must fit entirely inside the box, without overlapping interiors.
  • The rectangle enclosed by the box and the bounding box of OUTSIDE must fit entirely on the wall, without overlapping interiors.
  • No element may be rotated.

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.

Input

The input consists of five lines, each containing two integers representing a height and a width:

  • $$$a_1,l_1$$$: the box;
  • $$$a_2,l_2$$$: the THINK sticker;
  • $$$a_3,l_3$$$: the THE BOX sticker;
  • $$$a_4,l_4$$$: the OUTSIDE sticker;
  • $$$a_p,l_p$$$: the wall.
Every dimension is between $$$1$$$ and $$$1000$$$, inclusive.
Output

Print SIM (Portuguese for "yes") if the artwork fits on Luis's wall, or NAO ("no") otherwise.

Examples
Input
10 10
4 5
4 4
2 6
13 10
Output
SIM
Input
5 5
3 4
3 3
2 6
8 6
Output
NAO
Input
6 5
3 5
3 4
2 5
9 5
Output
SIM
Note

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.