N = int(input()) A = sorted(map(int, input().split())) if N == 1: ans = A[0] elif N % 2: ans = 1 else: ans = A[0] * A[1] print(ans)