IDENTIFICATION DIVISION.
PROGRAM-ID. A-Birthday.
 
DATA DIVISION.
WORKING-STORAGE SECTION.
01 INP      PIC X(100).
01 IN-A     PIC 9(3).
01 IN-B     PIC 9(3).
01 IN-C     PIC 9(3).
01 IN-D     PIC 9(3).
01 AB       PIC 9(3).
01 BC       PIC 9(3).
01 AC       PIC 9(3).

PROCEDURE DIVISION.
MAIN-001.
  ACCEPT INP.
  UNSTRING INP DELIMITED BY ALL ' '
      INTO IN-A IN-B IN-C IN-D.
  
  COMPUTE AB = IN-A - IN-B.
  COMPUTE BC = IN-B - IN-C.
  COMPUTE AC = IN-A - IN-C.

  IF (AC <= IN-D) OR (AB <= IN-D AND BC <= IN-D)
    DISPLAY 'Yes'
  ELSE 
    DISPLAY 'No'
  END-IF.
 
MAIN-EXIT.
  STOP RUN.