#abc324b. B - 3-smooth Numbers

B - 3-smooth Numbers

Score : 200200 points

问题描述

给定一个正整数 NN。若存在整数 xxyy 使得 N=2x3yN=2^x3^y,输出 Yes;否则,输出 No

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

You are given a positive integer NN. If there are integers xx and yy such that N=2x3yN=2^x3^y, print Yes; otherwise, print No.

Constraints

  • 1N10181\leq N\leq10^{18}
  • NN is an integer.

Input

The input is given from Standard Input in the following format:

NN

Output

Print a single line containing Yes if there are integers xx and yy that satisfy the condition, and No otherwise.

Sample Input 1

324

Sample Output 1

Yes

For x=2,y=4x=2,y=4, we have 2x3y=2234=4×81=3242^x3^y=2^23^4=4\times81=324, so the condition is satisfied. Thus, you should print Yes.

Sample Input 2

5

Sample Output 2

No

There are no integers xx and yy such that 2x3y=52^x3^y=5. Thus, you should print No.

Sample Input 3

32

Sample Output 3

Yes

For x=5,y=0x=5,y=0, we have 2x3y=32×1=322^x3^y=32\times1=32, so you should print Yes.

Sample Input 4

37748736

Sample Output 4

Yes

update @ 2024/3/10 01:45:42

}