You have 2 paintings of size a x b and c x d. You want to hang the paintings inside a rectangular board on the wall. The board has dimensions n x m. You are allowed to rotate the paintings but at least one edge of each of the paintings must be parallel to an edge of the board. The paintings can touch each other and the edges of the board but cannot overlap or go beyond the edge of the board. Is it possible to place the paintings on the board?
Input:
The input contains 3 lines in the form -
n m
a b
c d
First line contains space separated integers n and m. Second line contains space separated integers a and b. Third line contains space separated integers c and d.
Output:
If the paintings can be placed inside the board, print "Yes", print "No" otherwise.
Constraints:
All integers are in the range 1 to 1000.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor