n = int(input()) a = [int(v) for v in input().split()] if len(a) == 1: print(a[0]) elif len(a) == 2: print(a[0] * a[1]) elif len(a) % 2 == 0: print(1) else: print(a[0])