n = int(input()) A = list(reversed(sorted(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) else: print(A[-1])