import java.math.BigDecimal;
import java.util.Scanner;
 
public class Main {    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = "1";
        BigDecimal biga = new BigDecimal(s);
        BigDecimal one = new BigDecimal(s);
        String[] array = new String[n];
        for(int i=0;i<n;i++){
            array[i] = sc.next();
            if(array[i].equals("0")){
                System.out.println(0);
                sc.close();
                return;
            }
        }
        for(int i=0;i<n;i++){
            BigDecimal bigb = new BigDecimal(array[i]);
            biga = biga.multiply(bigb);
            if(biga.subtract(one).toString().length()>18){
                System.out.println(-1);
                sc.close();
                return;
            }
            biga.add(one);
        }
        String aa = biga.toString();
        long bb = Long.parseLong(aa);
        System.out.println(bb);
        sc.close();
    }
} import java.math.BigDecimal; BigDecimal java.math import java.util.Scanner; Scanner java.util public class Main {    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = "1";
        BigDecimal biga = new BigDecimal(s);
        BigDecimal one = new BigDecimal(s);
        String[] array = new String[n];
        for(int i=0;i<n;i++){
            array[i] = sc.next();
            if(array[i].equals("0")){
                System.out.println(0);
                sc.close();
                return;
            }
        }
        for(int i=0;i<n;i++){
            BigDecimal bigb = new BigDecimal(array[i]);
            biga = biga.multiply(bigb);
            if(biga.subtract(one).toString().length()>18){
                System.out.println(-1);
                sc.close();
                return;
            }
            biga.add(one);
        }
        String aa = biga.toString();
        long bb = Long.parseLong(aa);
        System.out.println(bb);
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = "1";
        BigDecimal biga = new BigDecimal(s);
        BigDecimal one = new BigDecimal(s);
        String[] array = new String[n];
        for(int i=0;i<n;i++){
            array[i] = sc.next();
            if(array[i].equals("0")){
                System.out.println(0);
                sc.close();
                return;
            }
        }
        for(int i=0;i<n;i++){
            BigDecimal bigb = new BigDecimal(array[i]);
            biga = biga.multiply(bigb);
            if(biga.subtract(one).toString().length()>18){
                System.out.println(-1);
                sc.close();
                return;
            }
            biga.add(one);
        }
        String aa = biga.toString();
        long bb = Long.parseLong(aa);
        System.out.println(bb);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = "1";
        BigDecimal biga = new BigDecimal(s);
        BigDecimal one = new BigDecimal(s);
        String[] array = new String[n];
        for(int i=0;i<n;i++){
            array[i] = sc.next();
            if(array[i].equals("0")){
                System.out.println(0);
                sc.close();
                return;
            }
        }
        for(int i=0;i<n;i++){
            BigDecimal bigb = new BigDecimal(array[i]);
            biga = biga.multiply(bigb);
            if(biga.subtract(one).toString().length()>18){
                System.out.println(-1);
                sc.close();
                return;
            }
            biga.add(one);
        }
        String aa = biga.toString();
        long bb = Long.parseLong(aa);
        System.out.println(bb);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String s = "1"; s "1" BigDecimal biga = new BigDecimal(s); biga new BigDecimal(s) BigDecimal one = new BigDecimal(s); one new BigDecimal(s) String[] array = new String[n]; array new String[n] n for(int i=0;i<n;i++){
            array[i] = sc.next();
            if(array[i].equals("0")){
                System.out.println(0);
                sc.close();
                return;
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            array[i] = sc.next();
            if(array[i].equals("0")){
                System.out.println(0);
                sc.close();
                return;
            }
        } {
            array[i] = sc.next();
            if(array[i].equals("0")){
                System.out.println(0);
                sc.close();
                return;
            }
        } array[i] = sc.next() array[i] array i sc.next() sc.next sc if(array[i].equals("0")){
                System.out.println(0);
                sc.close();
                return;
            } array[i].equals("0") array[i].equals array[i] array i "0" {
                System.out.println(0);
                sc.close();
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 sc.close() sc.close sc return; for(int i=0;i<n;i++){
            BigDecimal bigb = new BigDecimal(array[i]);
            biga = biga.multiply(bigb);
            if(biga.subtract(one).toString().length()>18){
                System.out.println(-1);
                sc.close();
                return;
            }
            biga.add(one);
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            BigDecimal bigb = new BigDecimal(array[i]);
            biga = biga.multiply(bigb);
            if(biga.subtract(one).toString().length()>18){
                System.out.println(-1);
                sc.close();
                return;
            }
            biga.add(one);
        } {
            BigDecimal bigb = new BigDecimal(array[i]);
            biga = biga.multiply(bigb);
            if(biga.subtract(one).toString().length()>18){
                System.out.println(-1);
                sc.close();
                return;
            }
            biga.add(one);
        } BigDecimal bigb = new BigDecimal(array[i]); bigb new BigDecimal(array[i]) biga = biga.multiply(bigb) biga biga.multiply(bigb) biga.multiply biga bigb if(biga.subtract(one).toString().length()>18){
                System.out.println(-1);
                sc.close();
                return;
            } biga.subtract(one).toString().length()>18 biga.subtract(one).toString().length() biga.subtract(one).toString().length biga.subtract(one).toString() biga.subtract(one).toString biga.subtract(one) biga.subtract biga one 18 {
                System.out.println(-1);
                sc.close();
                return;
            } System.out.println(-1) System.out.println System.out System System.out -1 1 sc.close() sc.close sc return; biga.add(one) biga.add biga one String aa = biga.toString(); aa biga.toString() biga.toString biga long bb = Long.parseLong(aa); bb Long.parseLong(aa) Long.parseLong Long aa System.out.println(bb) System.out.println System.out System System.out bb sc.close() sc.close sc String[] args args public class Main {    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = "1";
        BigDecimal biga = new BigDecimal(s);
        BigDecimal one = new BigDecimal(s);
        String[] array = new String[n];
        for(int i=0;i<n;i++){
            array[i] = sc.next();
            if(array[i].equals("0")){
                System.out.println(0);
                sc.close();
                return;
            }
        }
        for(int i=0;i<n;i++){
            BigDecimal bigb = new BigDecimal(array[i]);
            biga = biga.multiply(bigb);
            if(biga.subtract(one).toString().length()>18){
                System.out.println(-1);
                sc.close();
                return;
            }
            biga.add(one);
        }
        String aa = biga.toString();
        long bb = Long.parseLong(aa);
        System.out.println(bb);
        sc.close();
    }
} public class Main {    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = "1";
        BigDecimal biga = new BigDecimal(s);
        BigDecimal one = new BigDecimal(s);
        String[] array = new String[n];
        for(int i=0;i<n;i++){
            array[i] = sc.next();
            if(array[i].equals("0")){
                System.out.println(0);
                sc.close();
                return;
            }
        }
        for(int i=0;i<n;i++){
            BigDecimal bigb = new BigDecimal(array[i]);
            biga = biga.multiply(bigb);
            if(biga.subtract(one).toString().length()>18){
                System.out.println(-1);
                sc.close();
                return;
            }
            biga.add(one);
        }
        String aa = biga.toString();
        long bb = Long.parseLong(aa);
        System.out.println(bb);
        sc.close();
    }
} Main
import java.math.BigDecimal;
import java.util.Scanner;
 
public class Main {    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = "1";
        BigDecimal biga = new BigDecimal(s);
        BigDecimal one = new BigDecimal(s);
        String[] array = new String[n];
        for(int i=0;i<n;i++){
            array[i] = sc.next();
            if(array[i].equals("0")){
                System.out.println(0);
                sc.close();
                return;
            }
        }
        for(int i=0;i<n;i++){
            BigDecimal bigb = new BigDecimal(array[i]);
            biga = biga.multiply(bigb);
            if(biga.subtract(one).toString().length()>18){
                System.out.println(-1);
                sc.close();
                return;
            }
            biga.add(one);
        }
        String aa = biga.toString();
        long bb = Long.parseLong(aa);
        System.out.println(bb);
        sc.close();
    }
}