import java.util.*;
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long ans = 1;
        long a[] = new long[n];
        for(int i = 0; i < n; i++){
            a[i] = sc.nextLong();
            if(a[i]==0){
                ans=0;
                break;
            }
        }
        if(ans==0){
            System.out.println(ans);
        }
        else{
            for(int i = 0; i < n; i++){
                if(1000000000000000000l/ans>=a[i]){
                    ans *= a[i];
                }
                else{
                    ans = -1;
                    break;
                }
            }
            System.out.println(ans);
        }
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long ans = 1;
        long a[] = new long[n];
        for(int i = 0; i < n; i++){
            a[i] = sc.nextLong();
            if(a[i]==0){
                ans=0;
                break;
            }
        }
        if(ans==0){
            System.out.println(ans);
        }
        else{
            for(int i = 0; i < n; i++){
                if(1000000000000000000l/ans>=a[i]){
                    ans *= a[i];
                }
                else{
                    ans = -1;
                    break;
                }
            }
            System.out.println(ans);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long ans = 1;
        long a[] = new long[n];
        for(int i = 0; i < n; i++){
            a[i] = sc.nextLong();
            if(a[i]==0){
                ans=0;
                break;
            }
        }
        if(ans==0){
            System.out.println(ans);
        }
        else{
            for(int i = 0; i < n; i++){
                if(1000000000000000000l/ans>=a[i]){
                    ans *= a[i];
                }
                else{
                    ans = -1;
                    break;
                }
            }
            System.out.println(ans);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long ans = 1;
        long a[] = new long[n];
        for(int i = 0; i < n; i++){
            a[i] = sc.nextLong();
            if(a[i]==0){
                ans=0;
                break;
            }
        }
        if(ans==0){
            System.out.println(ans);
        }
        else{
            for(int i = 0; i < n; i++){
                if(1000000000000000000l/ans>=a[i]){
                    ans *= a[i];
                }
                else{
                    ans = -1;
                    break;
                }
            }
            System.out.println(ans);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long ans = 1; ans 1 long a[] = new long[n]; a new long[n] n for(int i = 0; i < n; i++){
            a[i] = sc.nextLong();
            if(a[i]==0){
                ans=0;
                break;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a[i] = sc.nextLong();
            if(a[i]==0){
                ans=0;
                break;
            }
        } {
            a[i] = sc.nextLong();
            if(a[i]==0){
                ans=0;
                break;
            }
        } a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc if(a[i]==0){
                ans=0;
                break;
            } a[i]==0 a[i] a i 0 {
                ans=0;
                break;
            } ans=0 ans 0 break; if(ans==0){
            System.out.println(ans);
        }
        else{
            for(int i = 0; i < n; i++){
                if(1000000000000000000l/ans>=a[i]){
                    ans *= a[i];
                }
                else{
                    ans = -1;
                    break;
                }
            }
            System.out.println(ans);
        } ans==0 ans 0 {
            System.out.println(ans);
        } System.out.println(ans) System.out.println System.out System System.out ans {
            for(int i = 0; i < n; i++){
                if(1000000000000000000l/ans>=a[i]){
                    ans *= a[i];
                }
                else{
                    ans = -1;
                    break;
                }
            }
            System.out.println(ans);
        } for(int i = 0; i < n; i++){
                if(1000000000000000000l/ans>=a[i]){
                    ans *= a[i];
                }
                else{
                    ans = -1;
                    break;
                }
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                if(1000000000000000000l/ans>=a[i]){
                    ans *= a[i];
                }
                else{
                    ans = -1;
                    break;
                }
            } {
                if(1000000000000000000l/ans>=a[i]){
                    ans *= a[i];
                }
                else{
                    ans = -1;
                    break;
                }
            } if(1000000000000000000l/ans>=a[i]){
                    ans *= a[i];
                }
                else{
                    ans = -1;
                    break;
                } 1000000000000000000l/ans>=a[i] 1000000000000000000l/ans 1000000000000000000l ans a[i] a i {
                    ans *= a[i];
                } ans *= a[i] ans a[i] a i {
                    ans = -1;
                    break;
                } ans = -1 ans -1 1 break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long ans = 1;
        long a[] = new long[n];
        for(int i = 0; i < n; i++){
            a[i] = sc.nextLong();
            if(a[i]==0){
                ans=0;
                break;
            }
        }
        if(ans==0){
            System.out.println(ans);
        }
        else{
            for(int i = 0; i < n; i++){
                if(1000000000000000000l/ans>=a[i]){
                    ans *= a[i];
                }
                else{
                    ans = -1;
                    break;
                }
            }
            System.out.println(ans);
        }
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long ans = 1;
        long a[] = new long[n];
        for(int i = 0; i < n; i++){
            a[i] = sc.nextLong();
            if(a[i]==0){
                ans=0;
                break;
            }
        }
        if(ans==0){
            System.out.println(ans);
        }
        else{
            for(int i = 0; i < n; i++){
                if(1000000000000000000l/ans>=a[i]){
                    ans *= a[i];
                }
                else{
                    ans = -1;
                    break;
                }
            }
            System.out.println(ans);
        }
    }
} Main
import java.util.*;
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long ans = 1;
        long a[] = new long[n];
        for(int i = 0; i < n; i++){
            a[i] = sc.nextLong();
            if(a[i]==0){
                ans=0;
                break;
            }
        }
        if(ans==0){
            System.out.println(ans);
        }
        else{
            for(int i = 0; i < n; i++){
                if(1000000000000000000l/ans>=a[i]){
                    ans *= a[i];
                }
                else{
                    ans = -1;
                    break;
                }
            }
            System.out.println(ans);
        }
    }
}