import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        int n;
        ArrayList<Long> aa = new ArrayList<Long>();
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        BigInteger min = BigInteger.valueOf(1L);
        final BigInteger max = BigInteger.valueOf(1_000_000_000_000_000_000L);
        for(int i=0; i<n; i++) {
            aa.add(sc.nextLong());
            if(aa.get(i)==0L) {
                System.out.println("0");
                return ;
            }
        }
        for(long a : aa) {
            min = min.multiply(BigInteger.valueOf(a));
            if(min.compareTo(max) > 0) {
                System.out.println("-1");
                return ;
            }
        }
            System.out.println(min);
        sc.close();
        
    }
} import java.math.BigInteger; BigInteger java.math import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        int n;
        ArrayList<Long> aa = new ArrayList<Long>();
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        BigInteger min = BigInteger.valueOf(1L);
        final BigInteger max = BigInteger.valueOf(1_000_000_000_000_000_000L);
        for(int i=0; i<n; i++) {
            aa.add(sc.nextLong());
            if(aa.get(i)==0L) {
                System.out.println("0");
                return ;
            }
        }
        for(long a : aa) {
            min = min.multiply(BigInteger.valueOf(a));
            if(min.compareTo(max) > 0) {
                System.out.println("-1");
                return ;
            }
        }
            System.out.println(min);
        sc.close();
        
    }
} Main public static void main(String[] args) {
        int n;
        ArrayList<Long> aa = new ArrayList<Long>();
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        BigInteger min = BigInteger.valueOf(1L);
        final BigInteger max = BigInteger.valueOf(1_000_000_000_000_000_000L);
        for(int i=0; i<n; i++) {
            aa.add(sc.nextLong());
            if(aa.get(i)==0L) {
                System.out.println("0");
                return ;
            }
        }
        for(long a : aa) {
            min = min.multiply(BigInteger.valueOf(a));
            if(min.compareTo(max) > 0) {
                System.out.println("-1");
                return ;
            }
        }
            System.out.println(min);
        sc.close();
        
    } main {
        int n;
        ArrayList<Long> aa = new ArrayList<Long>();
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        BigInteger min = BigInteger.valueOf(1L);
        final BigInteger max = BigInteger.valueOf(1_000_000_000_000_000_000L);
        for(int i=0; i<n; i++) {
            aa.add(sc.nextLong());
            if(aa.get(i)==0L) {
                System.out.println("0");
                return ;
            }
        }
        for(long a : aa) {
            min = min.multiply(BigInteger.valueOf(a));
            if(min.compareTo(max) > 0) {
                System.out.println("-1");
                return ;
            }
        }
            System.out.println(min);
        sc.close();
        
    } int n; n ArrayList<Long> aa = new ArrayList<Long>(); aa new ArrayList<Long>() Scanner sc = new Scanner(System.in); sc new Scanner(System.in) n = sc.nextInt() n sc.nextInt() sc.nextInt sc BigInteger min = BigInteger.valueOf(1L); min BigInteger.valueOf(1L) BigInteger.valueOf BigInteger 1L final BigInteger max = BigInteger.valueOf(1_000_000_000_000_000_000L); max BigInteger.valueOf(1_000_000_000_000_000_000L) BigInteger.valueOf BigInteger 1_000_000_000_000_000_000L for(int i=0; i<n; i++) {
            aa.add(sc.nextLong());
            if(aa.get(i)==0L) {
                System.out.println("0");
                return ;
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            aa.add(sc.nextLong());
            if(aa.get(i)==0L) {
                System.out.println("0");
                return ;
            }
        } {
            aa.add(sc.nextLong());
            if(aa.get(i)==0L) {
                System.out.println("0");
                return ;
            }
        } aa.add(sc.nextLong()) aa.add aa sc.nextLong() sc.nextLong sc if(aa.get(i)==0L) {
                System.out.println("0");
                return ;
            } aa.get(i)==0L aa.get(i) aa.get aa i 0L {
                System.out.println("0");
                return ;
            } System.out.println("0") System.out.println System.out System System.out "0" return ; for(long a : aa) {
            min = min.multiply(BigInteger.valueOf(a));
            if(min.compareTo(max) > 0) {
                System.out.println("-1");
                return ;
            }
        } long a aa {
            min = min.multiply(BigInteger.valueOf(a));
            if(min.compareTo(max) > 0) {
                System.out.println("-1");
                return ;
            }
        } {
            min = min.multiply(BigInteger.valueOf(a));
            if(min.compareTo(max) > 0) {
                System.out.println("-1");
                return ;
            }
        } min = min.multiply(BigInteger.valueOf(a)) min min.multiply(BigInteger.valueOf(a)) min.multiply min BigInteger.valueOf(a) BigInteger.valueOf BigInteger a if(min.compareTo(max) > 0) {
                System.out.println("-1");
                return ;
            } min.compareTo(max) > 0 min.compareTo(max) min.compareTo min max 0 {
                System.out.println("-1");
                return ;
            } System.out.println("-1") System.out.println System.out System System.out "-1" return ; System.out.println(min) System.out.println System.out System System.out min sc.close() sc.close sc String[] args args public class Main {

    public static void main(String[] args) {
        int n;
        ArrayList<Long> aa = new ArrayList<Long>();
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        BigInteger min = BigInteger.valueOf(1L);
        final BigInteger max = BigInteger.valueOf(1_000_000_000_000_000_000L);
        for(int i=0; i<n; i++) {
            aa.add(sc.nextLong());
            if(aa.get(i)==0L) {
                System.out.println("0");
                return ;
            }
        }
        for(long a : aa) {
            min = min.multiply(BigInteger.valueOf(a));
            if(min.compareTo(max) > 0) {
                System.out.println("-1");
                return ;
            }
        }
            System.out.println(min);
        sc.close();
        
    }
} public class Main {

    public static void main(String[] args) {
        int n;
        ArrayList<Long> aa = new ArrayList<Long>();
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        BigInteger min = BigInteger.valueOf(1L);
        final BigInteger max = BigInteger.valueOf(1_000_000_000_000_000_000L);
        for(int i=0; i<n; i++) {
            aa.add(sc.nextLong());
            if(aa.get(i)==0L) {
                System.out.println("0");
                return ;
            }
        }
        for(long a : aa) {
            min = min.multiply(BigInteger.valueOf(a));
            if(min.compareTo(max) > 0) {
                System.out.println("-1");
                return ;
            }
        }
            System.out.println(min);
        sc.close();
        
    }
} Main
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        int n;
        ArrayList<Long> aa = new ArrayList<Long>();
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        BigInteger min = BigInteger.valueOf(1L);
        final BigInteger max = BigInteger.valueOf(1_000_000_000_000_000_000L);
        for(int i=0; i<n; i++) {
            aa.add(sc.nextLong());
            if(aa.get(i)==0L) {
                System.out.println("0");
                return ;
            }
        }
        for(long a : aa) {
            min = min.multiply(BigInteger.valueOf(a));
            if(min.compareTo(max) > 0) {
                System.out.println("-1");
                return ;
            }
        }
            System.out.println(min);
        sc.close();
        
    }
}
