No.2682 Visible Divisible
Problem Statement
There is a very large number $X$. You want to know whether $X$ is a multiple of $K$.
Because $X$ is far too huge, you cannot directly divide $X$ by $K$. Instead, through your psychic powers, you have found out that $X$ is a multiple of $A_1, \ldots, A_N$.
Determine whether this information establishes for certain that $X$ is a multiple of $K$.
Constraints
- All input values are integers.
- $1\leq N\leq 2\times 10^5$
- $1\leq K\leq 10^{18}$
- $1\leq A_i\leq 10^{18}$
Input
$N$ $K$ $A_1$ $A_2$ $\ldots$ $A_N$
Output
Print Yes if it is certain that $X$ is a multiple of $K$, and No otherwise.
Sample
Sample 1
Input
3 12 3 4 10
Output
Yes
Since $X$ is a multiple of both $3$ and $4$, it follows that it is a multiple of $12$.
Sample 2
Input
2 8 2 4
Output
No
For example, when $X=4$, $X$ is not a multiple of $8$.
Sample 3
Input
25 101 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
Output
No
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
だれ
tute7627
SPD_9X2
kyawa
Ayuna