# https://codeforces.com/contest/560/problem/A
# https://codeforces.com/contest/560/submission/14575554

n = int(input())
l = list(map(int,input().split()))
if 1 in l:
    print('-1')
else:
    print('1')
