Buggy python submission (verdict: Runtime Error):
def possible(b):
    print('POSSIBLE' if b else 'IMPOSSIIBLE')

n, k = map(int, input().split())
A = list(map(int, input().split()))

if k in A:
    possible(True)
    exit()

if n == 1:
    possible(False)
    exit()
A = set(A)
A = list(A)
n = len(A)
A.sort()
D = [A[i + 1] - A[i] for i in range(n - 1)]
from fractions import *
g = D[0]
for d in D:
    g = gcd(g, d)

print('POSSIBLE' if k % g == 0 and k <= A[-1] else 'IMPOSSIBLE')


Fixed submission:
def possible(b):
    print('POSSIBLE' if b else 'IMPOSSIBLE')
    exit()

n, k = map(int, input().split())
A = list(set(map(int, input().split())))
n = len(A)

if k in A:
    possible(True)

if k > max(A):
    possible(False)

if n == 1:
    possible(False)

A.sort()
D = [A[i + 1] - A[i] for i in range(n - 1)]
from fractions import *
g = D[0]
for d in D:
    g = gcd(g, d)

possible(k % g == 0)

Buggy python submission (verdict: Runtime Error):
def possible(b):
    print('POSSIBLE' if b else 'IMPOSSIIBLE')

n, k = map(int, input().split())
A = list(map(int, input().split()))

if k in A:
    possible(True)
    exit()

if n == 1:
    possible(False)
    exit()
A = set(A)
A = list(A)

A.sort()
D = [A[i + 1] - A[i] for i in range(n - 1)]
from fractions import *
g = D[0]
for d in D:
    g = gcd(g, d)

print('POSSIBLE' if k % g == 0 and k <= A[-1] else 'IMPOSSIBLE')


Fixed submission:
def possible(b):
    print('POSSIBLE' if b else 'IMPOSSIBLE')
    exit()

n, k = map(int, input().split())
A = list(set(map(int, input().split())))
n = len(A)

if k in A:
    possible(True)

if k > max(A):
    possible(False)

if n == 1:
    possible(False)

A.sort()
D = [A[i + 1] - A[i] for i in range(n - 1)]
from fractions import *
g = D[0]
for d in D:
    g = gcd(g, d)

possible(k % g == 0)

Buggy python submission (verdict: Runtime Error):
def possible(b):
    print('POSSIBLE' if b else 'IMPOSSIIBLE')

n, k = map(int, input().split())
A = list(map(int, input().split()))

if k in A:
    possible(True)
    exit()

if n == 1:
    possible(False)
    exit()

A.sort()
D = [A[i + 1] - A[i] for i in range(n - 1)]
from fractions import *
g = D[0]
for d in D:
    g = gcd(g, d)

print('POSSIBLE' if k % g == 0 and k <= A[-1] else 'IMPOSSIBLE')


Fixed submission:
def possible(b):
    print('POSSIBLE' if b else 'IMPOSSIBLE')
    exit()

n, k = map(int, input().split())
A = list(set(map(int, input().split())))
n = len(A)

if k in A:
    possible(True)

if k > max(A):
    possible(False)

if n == 1:
    possible(False)

A.sort()
D = [A[i + 1] - A[i] for i in range(n - 1)]
from fractions import *
g = D[0]
for d in D:
    g = gcd(g, d)

possible(k % g == 0)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
A = list(map(int, input().split()))
if n == 1:
    print('IMPOSSIBLE')
    exit()
A.sort()
D = [A[i + 1] - A[i] for i in range(n - 1)]
from math import *
g = D[0]
for d in D:
    g = gcd(g, d)
print('POSSIBLE'if g == 1 else 'IMPOSSIBLE')


Fixed submission:
def possible(b):
    print('POSSIBLE' if b else 'IMPOSSIBLE')
    exit()

n, k = map(int, input().split())
A = list(set(map(int, input().split())))
n = len(A)

if k in A:
    possible(True)

if k > max(A):
    possible(False)

if n == 1:
    possible(False)

A.sort()
D = [A[i + 1] - A[i] for i in range(n - 1)]
from fractions import *
g = D[0]
for d in D:
    g = gcd(g, d)

possible(k % g == 0)