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

#GL0000038. Tạo giá trị bằng hiệu tuyệt đối (Getting Difference)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Tạo giá trị bằng hiệu tuyệt đối (Getting Difference)

Getting Difference

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

A box initially contains NN balls labeled AiA_i. You may repeatedly take two balls and add a new ball labeled with the absolute difference of their labels, while retaining both existing balls. Determine whether a ball labeled KK can ever appear.

Input

First line: N,KN,K. Second line: NN labels AiA_i.

Output

Print POSSIBLE if KK can occur, otherwise IMPOSSIBLE.

Subtasks

  • Subtask 1 (20 points): 1≤N≤71 \le N \le 7; 1≤K,Ai≤1001 \le K,A_i \le 100
  • Subtask 2 (30 points): 1≤N≤10001 \le N \le 1000; 1≤K,Ai≤1061 \le K,A_i \le 10^{6}
  • Subtask 3 (50 points): 1≤N≤1051 \le N \le 10^{5}; 1≤K,Ai≤1091 \le K,A_i \le 10^{9}

Examples

Input

3 7
9 3 4

Output

POSSIBLE

Explanation

From labels 33 and 44 obtain 11; then 9−1=89-1=8 and 8−1=78-1=7. Hence 77 is attainable.