A magic island Geraldion, where Gerald lives, has its own currency system. It uses banknotes of several values. But the problem is, the system is not perfect and sometimes it happens that Geraldionians cannot express a certain sum of money with any set of banknotes. Of course, they can use any number of banknotes of each value. Such sum is called unfortunate. Gerald wondered: what is the minimum unfortunate sum?

Input

The first line contains number n (1 ≤ n ≤ 1000) — the number of values of the banknotes that used in Geraldion. 

The second line contains n distinct space-separated numbers a1, a2, ..., an (1 ≤ ai ≤ 106) — the values of the banknotes.

Output

Print a single line — the minimum unfortunate sum. If there are no unfortunate sums, print  - 1.

Examples

Input

5
1 2 3 4 5


Output

-1
"""
Title: A. Currency System in Geraldion

Time Limit: time limit per test2 seconds
Memory Limit: memory limit per test256 megabytes

A magic island Geraldion, where Gerald lives, has its own currency system. It
uses banknotes of several values. But the problem is, the system is not
perfect and sometimes it happens that Geraldionians cannot express a certain
sum of money with any set of banknotes. Of course, they can use any number of
banknotes of each value. Such sum is called unfortunate. Gerald wondered: what
is the minimum unfortunate sum?



Test Cases:

    5  
    1 2 3 4 5  
    



    -1  
    


====================================

"""

# Input Scanners
import sys

class Scanner:

    def __init__(self):
        self.current_tokens = []

    def remaining_tokens(self):
        return len(self.current_tokens)

    def nextline(self):
        assert self.remaining_tokens() == 0, "Reading next line with remaining tokens"
        return input()

    def nexttokens(self):
        return self.nextline().split()
    
    def nexttoken(self):
        if len(self.current_tokens) == 0:
            self.current_tokens = self.nexttokens()
        assert self.remaining_tokens() > 0, "Not enough tokens to parse."
        return self.current_tokens.pop(0)

    def nextints(self, n=-1):
        if n == -1:
            return list(map(int, self.nexttokens()))
        else:
            return [self.nextint() for i in range(n)]
    
    def nextint(self):
        return int(self.nexttoken())

def quit():
    sys.exit(0)

stdin = Scanner()
nextint = stdin.nextint
nextints = stdin.nextints
nextline = stdin.nextline

# Useful Constants
EPS = 1e-7

n = nextint()
a = nextints()
a.sort()

if a[0] == 1:
    print(-1)
else:
    print(1)
