 IDENTIFICATION DIVISION.
 PROGRAM-ID. TEST079.

 DATA DIVISION.
 WORKING-STORAGE SECTION.
 
 01 INP.
  03 N1     PIC 9(1).
  03 N2     PIC 9(1).
  03 N3     PIC 9(1).
  03 N4     PIC 9(1).

 PROCEDURE DIVISION.

  ACCEPT INP.

  IF ((N1 = N2) AND (N2 = N3)) OR
     ((N2 = N3) AND (N3 = N4))
    DISPLAY 'Yes'
  ELSE
    DISPLAY 'No'
  END-IF.

  STOP RUN.