404506: GYM101521 J Posters

Memory Limit:64 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

J. Posterstime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard output

Alex and Bob are classmates and they are equally enthusiastic about football.

Needless to say, both of them have a vast collection of posters featuring football stars. They want to stick their posters on the classroom bulletin board, but the class teacher, when in a bad mood, may get annoyed with the posters and demand to have the posters removed.

To "not take any risk", they decide to install a rectangular mini bulletin board in the classroom. The bulletin board is H centimeters long and W centimeters wide. Also, to avoid unwanted attention, they are going to each stick one poster only on the bulletin board.

Both Alex's and Bob's posters are rectangular. Alex's poster is ha centimeters long and wa centimeters wide, where Bob's is hb centimeters long and wb centimeters wide.

Alex is going to stick his poster first, since it is he who came up with this brilliant idea of installing a mini bulletin board to reduce risk. He looks at his poster, then Bob's, and is suddenly not sure about whether he should let Bob stick his. He formulates the following two plans:

  • Plan A. If Bob's poster features football stars that he likes, he will try to stick his poster so that Bob will have space to stick his.
  • Plan B. If Bob's poster features football stars that he hates, he will try to stick his poster so that Bob will not have space to stick his.

Note that both Alex and Bob are stubborn people. There are several rules of sticking posters that they follow:

  • The posters must lie within the bulletin board. A poster can touch the board margin but must not exceed it by even a nanometer.
  • Bob's poster cannot cover Alex's poster, but the posters are allowed to touch.
  • The posters cannot be rotated or reflected.

Given the dimensions of the bulletin board and the two posters, determine if Alex can successfully execute his two plans. If he cannot stick his poster on the bulletin board, both of his plans are considered to have failed, regardless of whether Bob can stick his poster afterwards.

Input

The first line of input consists of two space-separated integers H and W, the dimensions (in centimeters) of the bulletin board.

The second line of input consists of two space-separated integers ha and wa, the dimensions (in centimeters) of Alex's poster.

The third line of input consists of two space-separated integers hb and wb, the dimensions (in centimeters) of Bob's poster.

It is guaranteed that 10 ≤ H, W, ha, wa, hb, wb ≤ 150.

Output

On the first line of output, output Yes if Alex can successfully execute Plan A and No if otherwise.

On the second line of output, output Yes if Alex can successfully execute Plan B and No if otherwise.

ExamplesInput
20 30
15 10
10 20
Output
Yes
Yes
Input
20 30
21 10
20 30
Output
No
No
Input
50 100
30 20
30 20
Output
Yes
No
Note

For sample case 1, Alex can execute both plans by placing his poster as shown below.

Therefore, you should output Yes on both lines.

加入题单

算法标签: