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