import java.util.*;
import javax.lang.model.util.ElementScanner6;
import java.lang.Math;

public class Main {

    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);

        // 入力
        //String t = sc.next();
        int n = sc.nextInt();

        // 
        long out = 1;
        long[] a = new long[n];
        boolean zeroflg = false;
        for(int i = 0; i < n; i++){
            a[i] = sc.nextLong();
            if (a[i] == 0){
                zeroflg = true;
                break;
            }
        }
        if(zeroflg == true){
            out = 0;
        } else{
            for(int i = 0; i < n; i++){
                if(Math.log10(out) + Math.log10(a[i]) > 18 ||
                    out * a[i] > 1000000000000000000L ){
                    out = -1;
                    break;
                } else {;           
                    out *= a[i];
                }
            }
        }

        // 出力
        System.out.println(out);
    }    
} import java.util.*; util.* java import javax.lang.model.util.ElementScanner6; ElementScanner6 javax.lang.model.util import java.lang.Math; Math java.lang public class Main {

    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);

        // 入力
        //String t = sc.next();
        int n = sc.nextInt();

        // 
        long out = 1;
        long[] a = new long[n];
        boolean zeroflg = false;
        for(int i = 0; i < n; i++){
            a[i] = sc.nextLong();
            if (a[i] == 0){
                zeroflg = true;
                break;
            }
        }
        if(zeroflg == true){
            out = 0;
        } else{
            for(int i = 0; i < n; i++){
                if(Math.log10(out) + Math.log10(a[i]) > 18 ||
                    out * a[i] > 1000000000000000000L ){
                    out = -1;
                    break;
                } else {;           
                    out *= a[i];
                }
            }
        }

        // 出力
        System.out.println(out);
    }    
} Main public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);

        // 入力
        //String t = sc.next();
        int n = sc.nextInt();

        // 
        long out = 1;
        long[] a = new long[n];
        boolean zeroflg = false;
        for(int i = 0; i < n; i++){
            a[i] = sc.nextLong();
            if (a[i] == 0){
                zeroflg = true;
                break;
            }
        }
        if(zeroflg == true){
            out = 0;
        } else{
            for(int i = 0; i < n; i++){
                if(Math.log10(out) + Math.log10(a[i]) > 18 ||
                    out * a[i] > 1000000000000000000L ){
                    out = -1;
                    break;
                } else {;           
                    out *= a[i];
                }
            }
        }

        // 出力
        System.out.println(out);
    } main {
        final Scanner sc = new Scanner(System.in);

        // 入力
        //String t = sc.next();
        int n = sc.nextInt();

        // 
        long out = 1;
        long[] a = new long[n];
        boolean zeroflg = false;
        for(int i = 0; i < n; i++){
            a[i] = sc.nextLong();
            if (a[i] == 0){
                zeroflg = true;
                break;
            }
        }
        if(zeroflg == true){
            out = 0;
        } else{
            for(int i = 0; i < n; i++){
                if(Math.log10(out) + Math.log10(a[i]) > 18 ||
                    out * a[i] > 1000000000000000000L ){
                    out = -1;
                    break;
                } else {;           
                    out *= a[i];
                }
            }
        }

        // 出力
        System.out.println(out);
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long out = 1; out 1 long[] a = new long[n]; a new long[n] n boolean zeroflg = false; zeroflg false for(int i = 0; i < n; i++){
            a[i] = sc.nextLong();
            if (a[i] == 0){
                zeroflg = true;
                break;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a[i] = sc.nextLong();
            if (a[i] == 0){
                zeroflg = true;
                break;
            }
        } {
            a[i] = sc.nextLong();
            if (a[i] == 0){
                zeroflg = true;
                break;
            }
        } a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc if (a[i] == 0){
                zeroflg = true;
                break;
            } a[i] == 0 a[i] a i 0 {
                zeroflg = true;
                break;
            } zeroflg = true zeroflg true break; if(zeroflg == true){
            out = 0;
        } else{
            for(int i = 0; i < n; i++){
                if(Math.log10(out) + Math.log10(a[i]) > 18 ||
                    out * a[i] > 1000000000000000000L ){
                    out = -1;
                    break;
                } else {;           
                    out *= a[i];
                }
            }
        } zeroflg == true zeroflg true {
            out = 0;
        } out = 0 out 0 {
            for(int i = 0; i < n; i++){
                if(Math.log10(out) + Math.log10(a[i]) > 18 ||
                    out * a[i] > 1000000000000000000L ){
                    out = -1;
                    break;
                } else {;           
                    out *= a[i];
                }
            }
        } for(int i = 0; i < n; i++){
                if(Math.log10(out) + Math.log10(a[i]) > 18 ||
                    out * a[i] > 1000000000000000000L ){
                    out = -1;
                    break;
                } else {;           
                    out *= a[i];
                }
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                if(Math.log10(out) + Math.log10(a[i]) > 18 ||
                    out * a[i] > 1000000000000000000L ){
                    out = -1;
                    break;
                } else {;           
                    out *= a[i];
                }
            } {
                if(Math.log10(out) + Math.log10(a[i]) > 18 ||
                    out * a[i] > 1000000000000000000L ){
                    out = -1;
                    break;
                } else {;           
                    out *= a[i];
                }
            } if(Math.log10(out) + Math.log10(a[i]) > 18 ||
                    out * a[i] > 1000000000000000000L ){
                    out = -1;
                    break;
                } else {;           
                    out *= a[i];
                } Math.log10(out) + Math.log10(a[i]) > 18 ||
                    out * a[i] > 1000000000000000000L Math.log10(out) + Math.log10(a[i]) > 18 Math.log10(out) + Math.log10(a[i]) Math.log10(out) Math.log10 Math out Math.log10(a[i]) Math.log10 Math a[i] a i 18 out * a[i] > 1000000000000000000L out * a[i] out a[i] a i 1000000000000000000L {
                    out = -1;
                    break;
                } out = -1 out -1 1 break; {;           
                    out *= a[i];
                } out *= a[i] out a[i] a i System.out.println(out) System.out.println System.out System System.out out final String[] args args public class Main {

    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);

        // 入力
        //String t = sc.next();
        int n = sc.nextInt();

        // 
        long out = 1;
        long[] a = new long[n];
        boolean zeroflg = false;
        for(int i = 0; i < n; i++){
            a[i] = sc.nextLong();
            if (a[i] == 0){
                zeroflg = true;
                break;
            }
        }
        if(zeroflg == true){
            out = 0;
        } else{
            for(int i = 0; i < n; i++){
                if(Math.log10(out) + Math.log10(a[i]) > 18 ||
                    out * a[i] > 1000000000000000000L ){
                    out = -1;
                    break;
                } else {;           
                    out *= a[i];
                }
            }
        }

        // 出力
        System.out.println(out);
    }    
} public class Main {

    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);

        // 入力
        //String t = sc.next();
        int n = sc.nextInt();

        // 
        long out = 1;
        long[] a = new long[n];
        boolean zeroflg = false;
        for(int i = 0; i < n; i++){
            a[i] = sc.nextLong();
            if (a[i] == 0){
                zeroflg = true;
                break;
            }
        }
        if(zeroflg == true){
            out = 0;
        } else{
            for(int i = 0; i < n; i++){
                if(Math.log10(out) + Math.log10(a[i]) > 18 ||
                    out * a[i] > 1000000000000000000L ){
                    out = -1;
                    break;
                } else {;           
                    out *= a[i];
                }
            }
        }

        // 出力
        System.out.println(out);
    }    
} Main
import java.util.*;
import javax.lang.model.util.ElementScanner6;
import java.lang.Math;

public class Main {

    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);

        // 入力
        //String t = sc.next();
        int n = sc.nextInt();

        // 
        long out = 1;
        long[] a = new long[n];
        boolean zeroflg = false;
        for(int i = 0; i < n; i++){
            a[i] = sc.nextLong();
            if (a[i] == 0){
                zeroflg = true;
                break;
            }
        }
        if(zeroflg == true){
            out = 0;
        } else{
            for(int i = 0; i < n; i++){
                if(Math.log10(out) + Math.log10(a[i]) > 18 ||
                    out * a[i] > 1000000000000000000L ){
                    out = -1;
                    break;
                } else {;           
                    out *= a[i];
                }
            }
        }

        // 出力
        System.out.println(out);
    }    
}
