Determine whether a number is divisible by at least one lucky number made only of digits 4 and 7.
Lucky Division
A positive integer is called lucky if every digit in its decimal representation is either 4 or 7.
Given an integer n, decide whether it is divisible by at least one lucky number.
If such a lucky divisor exists, the answer is YES; otherwise, the answer is NO.
A number itself may be lucky, and it may also have a smaller lucky divisor.
Input Format
- A single integer
n.
Output Format
- Print
YESifnhas at least one lucky divisor. - Otherwise print
NO.
Constraints
Example 1
Input
47
Output
YES
Explanation
47 is itself a lucky number, so it divides 47.
Example 2
Input
16
Output
YES
Explanation
16 is divisible by 4, and 4 is a lucky number.
Show 1 more example
Example 3
Input
17
Output
NO
Explanation
No lucky number divides 17.
Premium problem context
Unlock deeper context for this problem
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.