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.
The first line of the input contains a single integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">9</sup>) — Kolya's initial game-coin score.
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.
1359257
YES
17851817
NO
1000000000
YES
17851818
YES
438734347
YES
43873430
YES
999999987
YES
27406117
NO
27404883
NO
27403649
NO
27402415
NO
27401181
NO
999999999
YES
999999244
YES
999129999
YES
17159199
NO
13606913
NO
14841529
NO
915968473
YES
980698615
YES
912331505
YES
917261049
YES
999999997
YES
12345
NO
1234
YES
124690
YES
1359257
YES
1358023
YES
1234
YES
1234567
YES
124690
YES
1358023
YES
123456
YES
2592590
YES
999999998
YES
1356789
NO
12345670
YES
11
NO
1480800
YES
908000000
YES
3000
NO
1235801
YES
991919191
YES
25613715
YES
13580237
YES
14814804
YES
11403961
YES
999999989
YES
1237035
YES
81134231
YES
1236
NO
1359250
YES
100
NO
987654321
YES
122222
NO
123458
NO
20987639
YES
999973333
YES
253082
YES
1235
NO
803219200
YES
100000000
YES
1485181
YES
n = int(input())
check = 0
for i in range(0, n//1234567 + 1):
    for j in range(0, n//123456 + 1):
        if ((n - 1234567*i - 123456*j)%1234 == 0):
            check = 1
            break
if check == 1: print("YES")
else: print("NO")