Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()

def f(l, s):
    return s if l % s == 0 else f(s, l % s)

z = f(a[1], a[0])
for i in a:
    z = f(i, z)

if a[-1] >= k and k % z == 0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Fixed submission:
import sys
n, k = map(int, input().split())
a = list(map(int, input().split()))


a.sort()
if a[-1] < k:
    print('IMPOSSIBLE')
    sys.exit(0)

seta = set(a)
if k in seta:
    print('POSSIBLE')
    sys.exit(0)
change = True
while change:
    change = False
    setb = seta.copy()
    sorteda = sorted(seta)
    mini = sorteda[0] if sorteda[0] != 0 else sorteda[1]
    for i in range(1, len(sorteda)):
        setb.add(sorteda[i] % mini)
    if setb != seta:
        change = True
        seta = setb

mini = sorted(seta)[1]
a.reverse()

for i in a:
    if (k - i) % mini == 0:
        print('POSSIBLE')
        sys.exit(0)
print('IMPOSSIBLE')

Buggy python submission (verdict: Runtime Error):
import sys
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
seta = set(a)
lena = 0
while lena != len(seta):
    lena = len(seta)
    sorteda = sorted(seta)
    mini = sorteda[0] if sorteda[0] != 0 else sorteda[1]
    for i in range(1, len(sorteda)):
        seta.add(sorteda[i] % mini)

mini = sorted(seta)[1]
a.reverse()

if k <= a[0] and k % mini == 0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Fixed submission:
import sys
n, k = map(int, input().split())
a = list(map(int, input().split()))


a.sort()
if a[-1] < k:
    print('IMPOSSIBLE')
    sys.exit(0)

seta = set(a)
if k in seta:
    print('POSSIBLE')
    sys.exit(0)
change = True
while change:
    change = False
    setb = seta.copy()
    sorteda = sorted(seta)
    mini = sorteda[0] if sorteda[0] != 0 else sorteda[1]
    for i in range(1, len(sorteda)):
        setb.add(sorteda[i] % mini)
    if setb != seta:
        change = True
        seta = setb

mini = sorted(seta)[1]
a.reverse()

for i in a:
    if (k - i) % mini == 0:
        print('POSSIBLE')
        sys.exit(0)
print('IMPOSSIBLE')

Buggy python submission (verdict: Runtime Error):
import sys
n, k = map(int, input().split())
a = list(map(int, input().split()))

a.sort()
if a[-1] < k:
    print('IMPOSSIBLE')
    sys.exit(0)

seta = set(a)
change = True
while change:
    change = False
    setb = seta.copy()
    sorteda = sorted(seta)
    mini = sorteda[0] if sorteda[0] != 0 else sorteda[1]
    for i in range(1, len(sorteda)):
        setb.add(sorteda[i] % mini)
    if setb != seta:
        change = True
        seta = setb

mini = sorted(seta)[1]
a.reverse()

for i in a:
    if (k - i) % mini == 0:
        print('POSSIBLE')
        sys.exit(0)
print('IMPOSSIBLE')

Fixed submission:
import sys
n, k = map(int, input().split())
a = list(map(int, input().split()))


a.sort()
if a[-1] < k:
    print('IMPOSSIBLE')
    sys.exit(0)

seta = set(a)
if k in seta:
    print('POSSIBLE')
    sys.exit(0)
change = True
while change:
    change = False
    setb = seta.copy()
    sorteda = sorted(seta)
    mini = sorteda[0] if sorteda[0] != 0 else sorteda[1]
    for i in range(1, len(sorteda)):
        setb.add(sorteda[i] % mini)
    if setb != seta:
        change = True
        seta = setb

mini = sorted(seta)[1]
a.reverse()

for i in a:
    if (k - i) % mini == 0:
        print('POSSIBLE')
        sys.exit(0)
print('IMPOSSIBLE')

Buggy python submission (verdict: Runtime Error):
import sys
n, k = map(int, input().split())
a = list(map(int, input().split()))


if a[-1] < k:
    print('IMPOSSIBLE')
    sys.exit(0)

seta = set(a)
if k in seta:
    print('POSSIBLE')
    sys.exit(0)
change = True
while change:
    change = False
    setb = seta.copy()
    sorteda = sorted(seta)
    for i in range(1, len(sorteda)):
        setb.add(sorteda[i] % sorteda[0])
    if setb != seta:
        change = True
        seta = setb

mini = sorted(seta)[1]
a.sort()
a.reverse()

for i in a:
    if (k - i) % mini == 0:
        print('POSSIBLE')
        sys.exit(0)
print('IMPOSSIBLE')

Fixed submission:
import sys
n, k = map(int, input().split())
a = list(map(int, input().split()))


a.sort()
if a[-1] < k:
    print('IMPOSSIBLE')
    sys.exit(0)

seta = set(a)
if k in seta:
    print('POSSIBLE')
    sys.exit(0)
change = True
while change:
    change = False
    setb = seta.copy()
    sorteda = sorted(seta)
    mini = sorteda[0] if sorteda[0] != 0 else sorteda[1]
    for i in range(1, len(sorteda)):
        setb.add(sorteda[i] % mini)
    if setb != seta:
        change = True
        seta = setb

mini = sorted(seta)[1]
a.reverse()

for i in a:
    if (k - i) % mini == 0:
        print('POSSIBLE')
        sys.exit(0)
print('IMPOSSIBLE')