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
import java.io.* ;
import java.util.* ;
import java.util.stream.Collectors;

public class Solution {
    public static void main(String[] args)throws IOException{
        IO io = new IO() ;
        int n = io.getIntegerArray(1).get(0) ;
        ArrayList<Integer> arr = io.getIntegerArray(n) ;

        if(arr.contains(1))
            System.out.println(-1) ;
        else
            System.out.println(1) ;
    }

    public static int idxSub(String s, int idx, String p){
        if(idx == -1)
            return -1 ;
        for(int i = idx ; i < s.length() - 1 ; i++){
            if(s.charAt(i) == p.charAt(0) && s.charAt(i + 1) == p.charAt(1))
                return i ;
        }
        return -1 ;
    }
}

class Utils{
    static class IndexedElement<T>{
        int idx;
        T val ;
        public IndexedElement(int idx, T val){
            this.idx = idx ;
            this.val = val ;
        }

        @Override
        public String toString() {
            return "IndexedElement{" +
                    "idx=" + idx +
                    ", val=" + val +
                    '}';
        }
    }
    public static <T> ArrayList<IndexedElement<T>> getIndexedArray(ArrayList<T> ip){
        ArrayList<IndexedElement<T>> op = new ArrayList<>() ;
        for(int i = 0 ; i < ip.size() ; i++){
            op.add(new IndexedElement<>(i, ip.get(i))) ;
        }
        return op ;
    }
}

class IO{
    private BufferedReader br = null ;

    public IO(){
        this.br = new BufferedReader(new InputStreamReader(System.in)) ;
    }

    public ArrayList<Integer> getIntegerArray(int n)throws IOException{
        ArrayList<String> strings = this.getStringArray(n) ;
        return new ArrayList<>(strings.stream().map(Integer::parseInt).collect(Collectors.toList())) ;
    }

    public ArrayList<Long> getLongArray(int n)throws IOException{
        ArrayList<String> strings = this.getStringArray(n) ;
        return new ArrayList<>(strings.stream().map(Long::parseLong).collect(Collectors.toList())) ;
    }

    public ArrayList<Double> getDoubleArray(int n)throws IOException{
        ArrayList<String> strings = this.getStringArray(n) ;
        return new ArrayList<>(strings.stream().map(Double::parseDouble).collect(Collectors.toList())) ;
    }

    public ArrayList<String> getStringArray(int n)throws IOException{
        ArrayList<String> arr = new ArrayList<>() ;
        StringTokenizer st = new StringTokenizer(br.readLine()) ;

        while(st.hasMoreTokens()){
            arr.add(st.nextToken()) ;
        }

        return arr ;
    }

    static class Pair<T>{
        T a, b ;
        public Pair(T a, T b){
            this.a = a ;
            this.b = b ;
        }

        @Override
        public String toString() {
            return "Pair{" +
                    "a=" + a +
                    ", b=" + b +
                    '}';
        }
    }
    public ArrayList<Pair<Integer>> getIntegerPairArray(int n)throws IOException{
        ArrayList<Pair<Integer>> pairs = new ArrayList<>() ;
        for(int i = 0 ; i < n ; i++){
            StringTokenizer st = new StringTokenizer(br.readLine()) ;
            pairs.add(new Pair<>(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()))) ;
        }
        return pairs ;
    }
}