n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = a[0]
for i in range(1, n):
    if i % 2: ans *= a[i]
    else: ans = 1
print(ans)