       IDENTIFICATION DIVISION.
       PROGRAM-ID. ABC042-A.
       DATA DIVISION.
       FILE SECTION.
       WORKING-STORAGE SECTION.
       77 STR PIC X(100).
       77 COUNT5 PIC 9(1) VALUE ZERO.
       77 COUNT7 PIC 9(1) VALUE ZERO.

       PROCEDURE DIVISION.
       MAIN-PROCEDURE.
               ACCEPT STR FROM SYSIN.
               INSPECT STR TALLYING
                   COUNT5 FOR ALL "5"
                   COUNT7 FOR ALL "7".
               IF COUNT5 = 2 AND COUNT7 = 1 THEN
                   DISPLAY "YES"
               ELSE
                   DISPLAY "NO"
               END-IF
               STOP RUN.
       END PROGRAM ABC042-A.
