import sys input = sys.stdin.readline N=int(input()) A=list(map(int,input().split())) if N==1: print(A[0]) elif N==2: print(A[0]*A[1]) elif N%2==1: print(1) elif 1 in A: print(1) else: A.sort() B=A[2:]+[A[0]*A[1]] print(min(B))