PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000297. Trò chơi số dư (Remainders Game)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Trò chơi số dư (Remainders Game)

Remainders Game

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Pari secretly chooses a positive integer xx and reveals a positive integer kk to Arya. A list of nn positive integers c1,c2,…,cnc_1,c_2,\ldots,c_n is also known.

Arya may learn the remainders x mod cix\bmod c_i for any or all indices ii. Arya wants to determine uniquely the remainder x mod kx\bmod k, regardless of the secret value xx.

Decide whether this is always possible. If two different secrets can yield identical remainders for all cic_i but different remainders modulo kk, the answer is negative.

Input

The first line contains n,kn,k. The second line contains exactly nn positive integers c1,c2,…,cnc_1,c_2,\ldots,c_n.

Output

Print Yes if Arya can always determine x mod kx\bmod k; otherwise print No. Capitalization must match exactly.

Subtasks

  • Subtask 1 (20 points): 1≤n≤201\le n\le 20; 1≤k≤1001\le k\le 100; 1≤ci≤1001\le c_i\le 100 for each 1≤i≤n1\le i\le n.
  • Subtask 2 (30 points): 1≤n≤100001\le n\le 10000; 1≤k≤100001\le k\le 10000; 1≤ci≤100001\le c_i\le 10000 for each 1≤i≤n1\le i\le n.
  • Subtask 3 (50 points): 1≤n≤10000001\le n\le 1000000; 1≤k≤10000001\le k\le 1000000; 1≤ci≤10000001\le c_i\le 1000000 for each 1≤i≤n1\le i\le n.

Examples

Examples 1

Input

4 5
2 3 5 12

Output

Yes

Explanation

Since c3=5=kc_3=5=k, Arya can directly request x mod 5x\bmod 5, so the answer is Yes.

Examples 2

Input

2 7
2 3

Output

No

Explanation

The secrets x=1x=1 and x=7x=7 have identical remainders modulo both 22 and 33, but their remainders modulo 77 are 11 and 00, so the answer is No.