Codeforces Round 357 (Div. 2)
B
Economy Game
Codeforces
1300
原题
← AC →
翻译中…

Kolya is developing an economy simulator game. His most favourite part of the development process is in-game testing. Once he was entertained by the testing so much, that he found out his game-coin score become equal to $0$.

翻译中…

Kolya remembers that at the beginning of the game his game-coin score was equal to $*n*$ and that he have bought only some houses (for $1 234 567$ game-coins each), cars (for $123 456$ game-coins each) and computers (for $1 234$ game-coins each).

翻译中…

Kolya is now interested, whether he could have spent all of his initial $*n*$ game-coins buying only houses, cars and computers or there is a bug in the game. Formally, is there a triple of non-negative integers $*a*$, $*b*$ and $*c*$ such that $*a* × 1 234 567 + *b* × 123 456 + *c* × 1 234 = *n*$?

翻译中…

Please help Kolya answer this question.

翻译中…

Input

翻译中…

The first line of the input contains a single integer $*n*$ ($1 ≤ *n* ≤ 10^{9}$) — Kolya's initial game-coin score.

翻译中…

Output

翻译中…

Print "YES" (without quotes) if it's possible that Kolya spent all of his initial $*n*$ coins buying only houses, cars and computers. Otherwise print "NO" (without quotes).

翻译中…

Note

翻译中…

In the first sample, one of the possible solutions is to buy one house, one car and one computer, spending $1 234 567 + 123 456 + 1234 = 1 359 257$ game-coins in total.

翻译中…

样例

Input #1
1359257
Output #1
YES
InputCopy OutputCopy
Input #2
17851817
Output #2
NO
InputCopy OutputCopy
题目信息
题号
681B
时间限制
1 s
内存限制
256 MB
标签
暴力

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。