import java.util.*;
import java.util.function.*;
import java.lang.*;
import java.io.*;


public class Main {
    
    static boolean contains(long e, long[] array){
        for(int i=0; i<array.length; i++){
            if(array[i]==e) return true;
        }
        return false;
    }

    static long mults(long[] array){
        if(contains(0, array)) return 0;
        long ans = 1;
        for(int i=0; i<array.length; i++){
            if(ans > 1 + 1000000000000000000L / array[i]) return -1;
            ans *= array[i];
        }
        return ans > 1000000000000000000L ? -1 : ans;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] A = new long[N];
        for(int n=0; n<N; n++) A[n]=sc.nextLong();
        System.out.println(mults(A));
    }
} import java.util.*; util.* java import java.util.function.*; function.* java.util import java.lang.*; lang.* java import java.io.*; io.* java public class Main {
    
    static boolean contains(long e, long[] array){
        for(int i=0; i<array.length; i++){
            if(array[i]==e) return true;
        }
        return false;
    }

    static long mults(long[] array){
        if(contains(0, array)) return 0;
        long ans = 1;
        for(int i=0; i<array.length; i++){
            if(ans > 1 + 1000000000000000000L / array[i]) return -1;
            ans *= array[i];
        }
        return ans > 1000000000000000000L ? -1 : ans;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] A = new long[N];
        for(int n=0; n<N; n++) A[n]=sc.nextLong();
        System.out.println(mults(A));
    }
} Main static boolean contains(long e, long[] array){
        for(int i=0; i<array.length; i++){
            if(array[i]==e) return true;
        }
        return false;
    } contains {
        for(int i=0; i<array.length; i++){
            if(array[i]==e) return true;
        }
        return false;
    } for(int i=0; i<array.length; i++){
            if(array[i]==e) return true;
        } int i=0; int i=0; i 0 i<array.length i array.length array array.length i++ i++ i {
            if(array[i]==e) return true;
        } {
            if(array[i]==e) return true;
        } if(array[i]==e) return true; array[i]==e array[i] array i e return true; true return false; false long e e long[] array array static long mults(long[] array){
        if(contains(0, array)) return 0;
        long ans = 1;
        for(int i=0; i<array.length; i++){
            if(ans > 1 + 1000000000000000000L / array[i]) return -1;
            ans *= array[i];
        }
        return ans > 1000000000000000000L ? -1 : ans;
    } mults {
        if(contains(0, array)) return 0;
        long ans = 1;
        for(int i=0; i<array.length; i++){
            if(ans > 1 + 1000000000000000000L / array[i]) return -1;
            ans *= array[i];
        }
        return ans > 1000000000000000000L ? -1 : ans;
    } if(contains(0, array)) return 0; contains(0, array) contains 0 array return 0; 0 long ans = 1; ans 1 for(int i=0; i<array.length; i++){
            if(ans > 1 + 1000000000000000000L / array[i]) return -1;
            ans *= array[i];
        } int i=0; int i=0; i 0 i<array.length i array.length array array.length i++ i++ i {
            if(ans > 1 + 1000000000000000000L / array[i]) return -1;
            ans *= array[i];
        } {
            if(ans > 1 + 1000000000000000000L / array[i]) return -1;
            ans *= array[i];
        } if(ans > 1 + 1000000000000000000L / array[i]) return -1; ans > 1 + 1000000000000000000L / array[i] ans 1 + 1000000000000000000L / array[i] 1 1000000000000000000L / array[i] 1000000000000000000L array[i] array i return -1; -1 1 ans *= array[i] ans array[i] array i return ans > 1000000000000000000L ? -1 : ans; ans > 1000000000000000000L ? -1 : ans ans > 1000000000000000000L ans 1000000000000000000L -1 1 ans long[] array array public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] A = new long[N];
        for(int n=0; n<N; n++) A[n]=sc.nextLong();
        System.out.println(mults(A));
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] A = new long[N];
        for(int n=0; n<N; n++) A[n]=sc.nextLong();
        System.out.println(mults(A));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long[] A = new long[N]; A new long[N] N for(int n=0; n<N; n++) A[n]=sc.nextLong(); int n=0; int n=0; n 0 n<N n N n++ n++ n A[n]=sc.nextLong(); A[n]=sc.nextLong() A[n] A n sc.nextLong() sc.nextLong sc System.out.println(mults(A)) System.out.println System.out System System.out mults(A) mults A String[] args args public class Main {
    
    static boolean contains(long e, long[] array){
        for(int i=0; i<array.length; i++){
            if(array[i]==e) return true;
        }
        return false;
    }

    static long mults(long[] array){
        if(contains(0, array)) return 0;
        long ans = 1;
        for(int i=0; i<array.length; i++){
            if(ans > 1 + 1000000000000000000L / array[i]) return -1;
            ans *= array[i];
        }
        return ans > 1000000000000000000L ? -1 : ans;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] A = new long[N];
        for(int n=0; n<N; n++) A[n]=sc.nextLong();
        System.out.println(mults(A));
    }
} public class Main {
    
    static boolean contains(long e, long[] array){
        for(int i=0; i<array.length; i++){
            if(array[i]==e) return true;
        }
        return false;
    }

    static long mults(long[] array){
        if(contains(0, array)) return 0;
        long ans = 1;
        for(int i=0; i<array.length; i++){
            if(ans > 1 + 1000000000000000000L / array[i]) return -1;
            ans *= array[i];
        }
        return ans > 1000000000000000000L ? -1 : ans;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] A = new long[N];
        for(int n=0; n<N; n++) A[n]=sc.nextLong();
        System.out.println(mults(A));
    }
} Main
import java.util.*;
import java.util.function.*;
import java.lang.*;
import java.io.*;


public class Main {
    
    static boolean contains(long e, long[] array){
        for(int i=0; i<array.length; i++){
            if(array[i]==e) return true;
        }
        return false;
    }

    static long mults(long[] array){
        if(contains(0, array)) return 0;
        long ans = 1;
        for(int i=0; i<array.length; i++){
            if(ans > 1 + 1000000000000000000L / array[i]) return -1;
            ans *= array[i];
        }
        return ans > 1000000000000000000L ? -1 : ans;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] A = new long[N];
        for(int n=0; n<N; n++) A[n]=sc.nextLong();
        System.out.println(mults(A));
    }
}
