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