#include <stdio.h>
#include <math.h>
#include<stdlib.h>
int getGCF( int a, int b)
/* 获得两个数的最大公约数 */
{
int r;
if (a > b){
r = a % b;
if ( r == 0 )
return b;
else return getGCF(b, r);
}
else {
r = b % a;
if ( r == 0 )
return a;
else return getGCF(a, r);
}
}
long long getLCM( int a, int b)
/* 获得两个数的最小公倍数 */
{
long long l = ( long long)a;
long long l2 = ( long long)b;
long long l3 = ( long long)getGCF(a,b);
return l*l2/l3;
}
int main( void)
{
int i, n, m, j;
int *a;
long long t;
a = ( int*)malloc(10000* sizeof( int));
while(scanf( "%d %d",&n,&m)) {
for (i=0; i < n; i++) {
scanf( "%d", &(a[i]));
}
for (i=0; i < n; i++) {
t = a[i];
if (t == m) {
goto Possible;
}
for (j=i+1; j < n; j++) {
t = getLCM(t, a[j]);
if (t == m) {
goto Possible;
}
if (t > m) {
break;
}
}
}
printf( "Impossible\n");
continue;
Possible:
printf( "Possible\n");
}
free(a);
return 0;
}
#include <math.h>
#include<stdlib.h>
int getGCF( int a, int b)
/* 获得两个数的最大公约数 */
{
int r;
if (a > b){
r = a % b;
if ( r == 0 )
return b;
else return getGCF(b, r);
}
else {
r = b % a;
if ( r == 0 )
return a;
else return getGCF(a, r);
}
}
long long getLCM( int a, int b)
/* 获得两个数的最小公倍数 */
{
long long l = ( long long)a;
long long l2 = ( long long)b;
long long l3 = ( long long)getGCF(a,b);
return l*l2/l3;
}
int main( void)
{
int i, n, m, j;
int *a;
long long t;
a = ( int*)malloc(10000* sizeof( int));
while(scanf( "%d %d",&n,&m)) {
for (i=0; i < n; i++) {
scanf( "%d", &(a[i]));
}
for (i=0; i < n; i++) {
t = a[i];
if (t == m) {
goto Possible;
}
for (j=i+1; j < n; j++) {
t = getLCM(t, a[j]);
if (t == m) {
goto Possible;
}
if (t > m) {
break;
}
}
}
printf( "Impossible\n");
continue;
Possible:
printf( "Possible\n");
}
free(a);
return 0;
}