n = int(input()) A = list(map(int, input().split())) A.sort() if n == 1: print(A[0]) elif n == 2: print(A[0] * A[1]) elif n % 2 == 1: print(1) else: if A[1] == 1: print(1) elif A[0] == 1: print(A[1]) else: print(A[2])