3-smooth Numbers

AtCoder
IDabc324_b
Time2000ms
Memory256MB
Difficulty
You are given a positive integer $N$. If there are integers $x$ and $y$ such that $N=2^x3^y$, print `Yes`; otherwise, print `No`. ## Constraints * $1\leq N\leq10^{18}$ * $N$ is an integer. ## Input The input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
324
Output #1
Yes

For $x=2,y=4$, we have $2^x3^y=2^23^4=4\times81=324$, so the condition is satisfied. Thus, you should print `Yes`.
Input #2
5
Output #2
No

There are no integers $x$ and $y$ such that $2^x3^y=5$. Thus, you should print `No`.
Input #3
32
Output #3
Yes

For $x=5,y=0$, we have $2^x3^y=32\times1=32$, so you should print `Yes`.
Input #4
37748736
Output #4
Yes
API Response (JSON)
{
  "problem": {
    "name": "3-smooth Numbers",
    "description": {
      "content": "You are given a positive integer $N$. If there are integers $x$ and $y$ such that $N=2^x3^y$, print `Yes`; otherwise, print `No`.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc324_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given a positive integer $N$. If there are integers $x$ and $y$ such that $N=2^x3^y$, print `Yes`; otherwise, print `No`.\n\n## Constraints\n\n*   $1\\leq N\\leq10^{18}$\n*   $N$ is an integer.\n\n## I...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments