Codeforces Round 121 (Div. 2)
A
Funky Numbers
Codeforces
1300
原题
←B →
翻译中…

As you very well know, this year's funkiest numbers are so called triangular numbers (that is, integers that are representable as image, where $*k*$ is some positive integer), and the coolest numbers are those that are representable as a sum of two triangular numbers.

翻译中…

A well-known hipster Andrew adores everything funky and cool but unfortunately, he isn't good at maths. Given number $*n*$, help him define whether this number can be represented by a sum of two triangular numbers (not necessarily different)!

翻译中…

Input

翻译中…

The first input line contains an integer $*n*$ ($1 ≤ *n* ≤ 10^{9})$.

翻译中…

Output

翻译中…

Print "YES" (without the quotes), if $*n*$ can be represented as a sum of two triangular numbers, otherwise print "NO" (without the quotes).

翻译中…

Note

翻译中…

In the first sample number image.

翻译中…

In the second sample number $512$ can not be represented as a sum of two triangular numbers.

翻译中…

样例

Input #1
256
Output #1
YES
InputCopy OutputCopy
Input #2
512
Output #2
NO
InputCopy OutputCopy
题目信息
题号
192A
时间限制
2 s
内存限制
256 MB
标签
二分
暴力
模拟

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