# 愚直解(小さいケースの検算用) # bを実際に作って、lcmを計算 import itertools as itr def gcd(a, b): if b == 0: return a return gcd(b, a % b) def lcm(a, b): return a * b // gcd(a, b) N, K = map(int, input().split()) a = list(map(int, input().split())) b = [] for elements in itr.combinations(a, K): x = 1 for y in elements: x *= y b.append(x) ans = 1 for bx in b: ans = lcm(ans, bx) print(ans)