#K64387. Exact Notebook Purchase
Exact Notebook Purchase
Exact Notebook Purchase
You are given an amount \(M\) dollars. You need to determine whether it is possible to exactly spend \(M\) dollars by purchasing some combination of two types of notebooks. The notebooks have the following prices:
- Type A notebook: \(5\) dollars
- Type B notebook: \(9\) dollars
In mathematical terms, you are to decide if there exist nonnegative integers \(i\) and \(j\) such that:
\[ 5i + 9j = M \]If such integers exist, output Yes
; otherwise, output No
.
inputFormat
The input consists of a single integer \(M\) that represents the total amount of dollars available. The integer is read from standard input.
outputFormat
Output a single string: Yes
if it is possible to exactly spend \(M\) dollars by buying notebooks priced at \(5\) and \(9\) dollars; otherwise, output No
. The result should be printed to standard output.
14
Yes