IDENTIFICATION DIVISION.
PROGRAM-ID. 144B.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 N     PIC 9(3).
01 I     PIC 9(2).
01 F9    PIC X(3).
01 S     PIC 9(3).
01 A     PIC 9(1).
*>
PROCEDURE DIVISION.
  ACCEPT N.
*>
  MOVE 'No' TO F9.
  PERFORM VARYING I FROM 1 BY 1 
    UNTIL I > 9 OR F9 = 'Yes' 
    DIVIDE N BY I GIVING S REMAINDER A
    IF (A = 0) AND (S <= 9)
      MOVE 'Yes' TO F9
    END-IF
  END-PERFORM.
*>
  DISPLAY F9.
  STOP RUN.
