from heapq import heapify, heappush, heappop n = int(input()) A = sorted(list(map(int,input().split()))) if n == 1 or n == 2: A.append(1) print(A[0]*A[1]) exit() if n % 2: print(1) exit() num = A[0]*A[1] print(num)