#P11060. 【MX-X4-T0】「Jason-1」x!
【MX-X4-T0】「Jason-1」x!
Background
Original problem link: https://oier.team/problems/X4A.
Problem Description
Given a non-negative integer , determine whether is a multiple of . If it is, output YES; otherwise, output NO.
Here, denotes the factorial of , which is the product of all positive integers less than or equal to . For example, . It is also defined that .
Input Format
Only one line: a non-negative integer .
Output Format
Only one line: a string YES or NO, indicating whether is a multiple of .
0
YES
3
NO
6
NO
7
YES
15
YES
Hint
Sample Explanation #1
, and is a multiple of , so output YES.
Sample Explanation #2
, and is not a multiple of , so output NO.
Sample Explanation #3
$6! = 1 \times 2 \times 3 \times 4 \times 5 \times 6 = 720$, and is not a multiple of , so output NO.
Sample Explanation #4
$7! = 1 \times 2 \times 3 \times 4 \times 5 \times 6 \times 7= 5040$, and is a multiple of , so output YES.
Sample Explanation #5
$15! = 1 \times 2 \times 3 \times 4 \times 5 \times 6 \times 7 \times 8 \times 9 \times 10 \times 11 \times 12 \times 13 \times 14 \times 15 = 1{,}3076{,}7436{,}8000$, and is a multiple of , so output YES.
Constraints
This problem has test points. In the -th test point, is .
For of the data, .
Translated by ChatGPT 5