4690: Remainders Game

内存限制:256 MB 时间限制:2 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:5 通过:2

题目描述

B. Remainders Game


每次测试的时间限制

1秒

每次测试的内存限制

256字节

输入

标准输入

输出

标准输出

今天帕里和艾莉亚在玩一个名为“剩余者”的游戏。

Pari选择了两个正整数x和k,并告诉Arya k而不是x。Arya必须找出这个值。有n个古老的数字c1 c2…如果艾莉亚愿意,她必须告诉艾莉亚。已知k和古老的值,告诉我们Arya是否有一个独立于x值的制胜策略。从形式上讲,Arya真的能理解任何正整数x的值吗?

注意,这意味着x除以y后的余数。

输入

输入的第一行包含两个整数n和k(1≤n, k≤1000000)−Pari选择的古代整数的数量和值k。

第二行包含n个整数c1,c2,…ci, cn(1≤≤1000000)。

输出

如果Arya拥有独立于x值的制胜策略,则打印“Yes”(不带引号),否则打印“No”(不带引号)。

time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Today Pari and Arya are playing a game called Remainders.
Pari chooses two positive integer x and k, and tells Arya k but not x. Arya have to find the value . There are n ancient numbers c1,c2,...,cn and Pari has to tell Arya if Arya wants. Given k and the ancient values, tell us if Arya has a winning strategy independent of value of x or not. Formally, is it true that Arya can understand the value for any positive integer x?
Note, that means the remainder of x after dividing it by y.
Input
The first line of the input contains two integers n and k (1≤n, k≤1000000)− the number of ancient integers and value k that is chosen by Pari.
The second line contains n integers c1,c2,...,cn (1≤ci≤1000000).
Output
Print "Yes" (without quotes) if Arya has a winning strategy independent of value of x, or "No" (without quotes) otherwise.
Examples
Input
4 5
2 3 5 12
Output
Yes
Input
2 7
2 3
Output
No
Note
In the first sample, Arya can understand because 5 is one of the ancient numbers.
In the second sample, Arya can't be sure what is. For example 1 and 7 have the same remainders after dividing by 2 and 3, but they differ in remainders after dividing by 7.

输入样例 复制


输出样例 复制