import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        
        int N = scanner.nextInt();
        long[] A = new long[N];
        long Sum = 1;
        int hantei = 1;
        boolean hnt = true;
        long S = (long)Math.pow(10,18);
        
        for(int i=0; i<N; i++){
            A[i] = scanner.nextLong();
            if(A[i]==0){
                hantei = 0;
            }
        }
        
        for(int i=0; i<N; i++){
            if(A[i]<=S/Sum){
                Sum *= A[i];
            }else{
                hnt = false;
                break;
            }
        }
        
        
        if(hantei==0){
            System.out.println(0);
        }else if(hnt){
            System.out.println(Sum);
        }else{
            System.out.println(-1);
        }

    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        
        int N = scanner.nextInt();
        long[] A = new long[N];
        long Sum = 1;
        int hantei = 1;
        boolean hnt = true;
        long S = (long)Math.pow(10,18);
        
        for(int i=0; i<N; i++){
            A[i] = scanner.nextLong();
            if(A[i]==0){
                hantei = 0;
            }
        }
        
        for(int i=0; i<N; i++){
            if(A[i]<=S/Sum){
                Sum *= A[i];
            }else{
                hnt = false;
                break;
            }
        }
        
        
        if(hantei==0){
            System.out.println(0);
        }else if(hnt){
            System.out.println(Sum);
        }else{
            System.out.println(-1);
        }

    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        
        int N = scanner.nextInt();
        long[] A = new long[N];
        long Sum = 1;
        int hantei = 1;
        boolean hnt = true;
        long S = (long)Math.pow(10,18);
        
        for(int i=0; i<N; i++){
            A[i] = scanner.nextLong();
            if(A[i]==0){
                hantei = 0;
            }
        }
        
        for(int i=0; i<N; i++){
            if(A[i]<=S/Sum){
                Sum *= A[i];
            }else{
                hnt = false;
                break;
            }
        }
        
        
        if(hantei==0){
            System.out.println(0);
        }else if(hnt){
            System.out.println(Sum);
        }else{
            System.out.println(-1);
        }

    } main {
        
        Scanner scanner = new Scanner(System.in);
        
        int N = scanner.nextInt();
        long[] A = new long[N];
        long Sum = 1;
        int hantei = 1;
        boolean hnt = true;
        long S = (long)Math.pow(10,18);
        
        for(int i=0; i<N; i++){
            A[i] = scanner.nextLong();
            if(A[i]==0){
                hantei = 0;
            }
        }
        
        for(int i=0; i<N; i++){
            if(A[i]<=S/Sum){
                Sum *= A[i];
            }else{
                hnt = false;
                break;
            }
        }
        
        
        if(hantei==0){
            System.out.println(0);
        }else if(hnt){
            System.out.println(Sum);
        }else{
            System.out.println(-1);
        }

    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner long[] A = new long[N]; A new long[N] N long Sum = 1; Sum 1 int hantei = 1; hantei 1 boolean hnt = true; hnt true long S = (long)Math.pow(10,18); S (long)Math.pow(10,18) Math.pow Math 10 18 for(int i=0; i<N; i++){
            A[i] = scanner.nextLong();
            if(A[i]==0){
                hantei = 0;
            }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            A[i] = scanner.nextLong();
            if(A[i]==0){
                hantei = 0;
            }
        } {
            A[i] = scanner.nextLong();
            if(A[i]==0){
                hantei = 0;
            }
        } A[i] = scanner.nextLong() A[i] A i scanner.nextLong() scanner.nextLong scanner if(A[i]==0){
                hantei = 0;
            } A[i]==0 A[i] A i 0 {
                hantei = 0;
            } hantei = 0 hantei 0 for(int i=0; i<N; i++){
            if(A[i]<=S/Sum){
                Sum *= A[i];
            }else{
                hnt = false;
                break;
            }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            if(A[i]<=S/Sum){
                Sum *= A[i];
            }else{
                hnt = false;
                break;
            }
        } {
            if(A[i]<=S/Sum){
                Sum *= A[i];
            }else{
                hnt = false;
                break;
            }
        } if(A[i]<=S/Sum){
                Sum *= A[i];
            }else{
                hnt = false;
                break;
            } A[i]<=S/Sum A[i] A i S/Sum S Sum {
                Sum *= A[i];
            } Sum *= A[i] Sum A[i] A i {
                hnt = false;
                break;
            } hnt = false hnt false break; if(hantei==0){
            System.out.println(0);
        }else if(hnt){
            System.out.println(Sum);
        }else{
            System.out.println(-1);
        } hantei==0 hantei 0 {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 if(hnt){
            System.out.println(Sum);
        }else{
            System.out.println(-1);
        } hnt {
            System.out.println(Sum);
        } System.out.println(Sum) System.out.println System.out System System.out Sum {
            System.out.println(-1);
        } System.out.println(-1) System.out.println System.out System System.out -1 1 String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        
        int N = scanner.nextInt();
        long[] A = new long[N];
        long Sum = 1;
        int hantei = 1;
        boolean hnt = true;
        long S = (long)Math.pow(10,18);
        
        for(int i=0; i<N; i++){
            A[i] = scanner.nextLong();
            if(A[i]==0){
                hantei = 0;
            }
        }
        
        for(int i=0; i<N; i++){
            if(A[i]<=S/Sum){
                Sum *= A[i];
            }else{
                hnt = false;
                break;
            }
        }
        
        
        if(hantei==0){
            System.out.println(0);
        }else if(hnt){
            System.out.println(Sum);
        }else{
            System.out.println(-1);
        }

    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        
        int N = scanner.nextInt();
        long[] A = new long[N];
        long Sum = 1;
        int hantei = 1;
        boolean hnt = true;
        long S = (long)Math.pow(10,18);
        
        for(int i=0; i<N; i++){
            A[i] = scanner.nextLong();
            if(A[i]==0){
                hantei = 0;
            }
        }
        
        for(int i=0; i<N; i++){
            if(A[i]<=S/Sum){
                Sum *= A[i];
            }else{
                hnt = false;
                break;
            }
        }
        
        
        if(hantei==0){
            System.out.println(0);
        }else if(hnt){
            System.out.println(Sum);
        }else{
            System.out.println(-1);
        }

    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        
        int N = scanner.nextInt();
        long[] A = new long[N];
        long Sum = 1;
        int hantei = 1;
        boolean hnt = true;
        long S = (long)Math.pow(10,18);
        
        for(int i=0; i<N; i++){
            A[i] = scanner.nextLong();
            if(A[i]==0){
                hantei = 0;
            }
        }
        
        for(int i=0; i<N; i++){
            if(A[i]<=S/Sum){
                Sum *= A[i];
            }else{
                hnt = false;
                break;
            }
        }
        
        
        if(hantei==0){
            System.out.println(0);
        }else if(hnt){
            System.out.println(Sum);
        }else{
            System.out.println(-1);
        }

    }
}
