import sys input = sys.stdin.readline mod=998244353 # x以下の素数の列挙,素因数分解,約数の列挙 import math x=10**6+1 L=math.floor(math.sqrt(x)) # 平方根を求める Primelist=[i for i in range(x+1)] Primelist[1]=0 # 1は素数でないので0にする. for i in Primelist: if i>L: break if i==0: continue for j in range(2*i,x+1,i): Primelist[j]=0 Primes=[Primelist[j] for j in range(x+1) if Primelist[j]!=0] from math import gcd,lcm N,K=list(map(int,input().split())) A=list(map(int,input().split())) ANS=1 for p in Primes: L=[] for a in A: x=a count=0 while x%p==0: count+=1 x//=p L.append(count) #print(p,L) L.sort() c=L[K-1] ANS=ANS*pow(p,c)%mod print(ANS)