Under construction

Still being built. Things may change

Other Side

Time limit2sMemory limit512 MB

Level

Not classified yet

Solved
No attempts yet

Problem

John Doe wants to move his possessions from one bank of Lake Michigan to the other. He has W wolves, S sheep, and C cabbages. A boat that holds up to K of these items at once carries them across. In each step, John takes some items from one bank and moves them to the other bank. When left unsupervised, wolves eat sheep and sheep eat cabbages (wolves do not eat cabbages). John does not want to lose any possessions, so he needs a plan that prevents this. With John present, any combination of items is allowed, both on the banks and in the boat. This also holds during loading. John is not very good at problems like this, so he asks you for help.

Input

The input is a single line with four integers W, S, C, K. The input satisfies the following constraints:

  • 0≤W,S,C,K≤1060 \le W, S, C, K \le 10^6
  • 1≤max⁡(W,S,C)1 \le \max(W, S, C)

Output

If the transportation can be done without losing any items, print YES. Otherwise, print NO.

Examples2

  1. Example 1

    Input
    1 1 1 1
    
    Expected output
    YES
    
  2. Example 2

    Input
    2 2 0 1
    
    Expected output
    NO