Given a number, determine whether it is divisible by 19 using the digit-sum style rule associated with the problem.
Problem
You are given an integer as a decimal string. Determine whether it satisfies the condition for being a multiple of 19.
A common way to solve this kind of task is to repeatedly transform the number using the rule from the problem statement until the result becomes small enough to check directly.
Return whether the number is divisible by 19.
Notes
- The input may be very large, so it is safer to treat it as a string rather than converting it directly to a fixed-width integer.
- The intended solution relies on arithmetic properties of 19 rather than brute force division by repeated subtraction.
Input Format
- A single decimal integer represented as a string.
Input
The input contains one number .
Output Format
Print YES if the number is divisible by 19, otherwise print NO.
Constraints
- .
- consists only of decimal digits.
- The number may be too large for built-in integer types.
Example 1
Input
19
Output
YES
Explanation
19 is divisible by 19.
Example 2
Input
20
Output
NO
Explanation
20 is not divisible by 19.
Show 1 more example
Example 3
Input
190
Output
YES
Explanation
190 = 19 × 10, so it is divisible by 19.
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.