PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#BS0000236. Tổng hai lập phương (Sum of Cubes)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Tổng hai lập phương (Sum of Cubes)

Sum of Cubes

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given a positive integer xx, decide whether it equals a3+b3a^3+b^3 for some positive integers a,ba,b. The integers may be equal but neither may be zero. For example, 28=13+3328=1^3+3^3.

Input

The only line contains positive integer xx.

Output

Print YES if such a pair exists, otherwise print NO.

Subtasks

  • Subtask 1 (20 points): 1≤x≤1031\le x\le10^3.
  • Subtask 2 (30 points): 1≤x≤1081\le x\le10^8.
  • Subtask 3 (50 points): 1≤x≤10121\le x\le10^{12}.

Examples

Input

28

Output

YES

Explanation

13=11^3=1 and 33=273^3=27 sum to 28. Both integers are positive.

Input

27

Output

NO

Explanation

Positive cubes at most 27 are 1, 8 and 27. A summand of 27 already leaves no room for a positive second summand. The remaining sums are 2, 9 and 16.