IDENTIFICATION DIVISION.
PROGRAM-ID. 161B.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 INP        PIC X(6000).
01 N          PIC 9(3).
01 M          PIC 9(3).
01 KS         PIC 9(3). 
01 GK         PIC 9(5) COMP.
01 I          PIC 9(4) COMP.
01 J          PIC 9(4) COMP.
01 P1         PIC 9(4) COMP.
01 P2         PIC 9(4) COMP.
01 S          PIC 9(4).
01 T-TBL.
   03 A-T     PIC 9(3) OCCURS 1000.
*>
PROCEDURE DIVISION.
  ACCEPT INP.
  UNSTRING INP DELIMITED BY ' '
      INTO N M.
*>
  PERFORM VARYING I FROM 1 BY 1 UNTIL I > 1000
    MOVE 0  TO A-T(I)
  END-PERFORM.
*>
  MOVE 0 TO GK.
  ACCEPT INP.
  MOVE 1 TO P1.
  PERFORM VARYING I FROM 1 BY 1 UNTIL I > N
    PERFORM VARYING P2 FROM P1 BY 1 UNTIL INP(P2:1) = ' '
    END-PERFORM
    MOVE INP(P1:P2 - P1) TO J
    ADD 1 TO A-T(J)
    ADD J TO GK
    COMPUTE P1 = P2 + 1
  END-PERFORM.
*>
  MOVE 0 TO KS.
  COMPUTE S = GK / (4 * M) + 0.999.
  PERFORM VARYING I FROM S BY 1 UNTIL I > 1000
    ADD A-T(I) TO KS
  END-PERFORM.
*>
  IF (KS >= M)
    DISPLAY 'Yes'
  ELSE 
    DISPLAY 'No'
  END-IF.
  STOP RUN.
