P11060 [MX-X4-T0] "Jason-1" x!

Background

Original problem link: .

Description

Given a non-negative integer $n$, determine whether $n!$ is a multiple of $n+1$. If it is, output `YES`; otherwise, output `NO`. Here, $n!$ denotes the factorial of $n$, which is the product of all positive integers less than or equal to $n$. For example, $3! = 1 \times 2 \times 3 = 6$. It is also defined that $0! = 1$.

Input Format

Only one line: a non-negative integer $n$.

Output Format

Only one line: a string `YES` or `NO`, indicating whether $n!$ is a multiple of $n+1$.

Explanation/Hint

**Sample Explanation #1** $0! = 1$, and $1$ is a multiple of $1$, so output `YES`. **Sample Explanation #2** $3! = 1 \times 2 \times 3 = 6$, and $6$ is not a multiple of $4$, so output `NO`. **Sample Explanation #3** $6! = 1 \times 2 \times 3 \times 4 \times 5 \times 6 = 720$, and $720$ is not a multiple of $7$, so output `NO`. **Sample Explanation #4** $7! = 1 \times 2 \times 3 \times 4 \times 5 \times 6 \times 7= 5040$, and $5040$ is a multiple of $8$, 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 $1{,}3076{,}7436{,}8000$ is a multiple of $16$, so output `YES`. **Constraints** This problem has $20$ test points. In the $i$-th test point, $n$ is $i-1$. For $100\%$ of the data, $0 \le n \le 19$. Translated by ChatGPT 5