問題一覧 > 通常問題

No.1003 Dice Implementation (1)

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 640
作問者 : trineutron / テスター : 37zigen
お気に入りにしたユーザー ProblemId : 3863 / 自分の提出
問題文最終更新日: 2022-04-26 01:58:04
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 240 (順位表) の他の問題:

Problem Statement

Dice are used in many games, but a poor implementation can produce dice that are clearly biased.

There is a random number generator that generates integers from $0$ to $N - 1$ with equal probability. The result of the die roll is the integer obtained by adding $1$ to the remainder when the generated integer is divided by $6$. For example, if $21$ is generated, the result of the roll is $4$. Determine whether this method can make the die rolls free of bias.

Input

$N$

An integer $N$ satisfying $1 \le N \le 2^{16}$ is given on 1 line.

Output

Print Yes if an unbiased die can be made by the method described in the problem statement, and No otherwise. Print a newline at the end.

Sample

Sample 1
Input
8
Output
No

The probability of rolling 1 or 2 is 2/8 each, and the probability of rolling each of 3 through 6 is 1/8.

Sample 2
Input
6
Output
Yes

The probability of rolling each of 1 through 6 is 1/6.

Sample 3
Input
65536
Output
No

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。