
import java.io.*;
import java.util.*;

class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());

        int N = Integer.parseInt(st.nextToken());
        long[] arr = new long[N];
        st = new StringTokenizer(br.readLine());
        for (int i=0; i<N; i++)
            arr[i] = Long.parseLong(st.nextToken());
        Arrays.sort(arr);

        long res = 1;
        for (int i=0; i<N; i++){
            try{
                res = Math.multiplyExact(res,arr[i]);
            }
            catch (Exception e){
                res = -1;
                break;
            }
            if (res>1000000000000000000L){
                res=-1;
                break;
            }
            if(res==0){
                break;
            }

        }
        System.out.println(res);

    }



} import java.io.*; io.* java import java.util.*; util.* java class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());

        int N = Integer.parseInt(st.nextToken());
        long[] arr = new long[N];
        st = new StringTokenizer(br.readLine());
        for (int i=0; i<N; i++)
            arr[i] = Long.parseLong(st.nextToken());
        Arrays.sort(arr);

        long res = 1;
        for (int i=0; i<N; i++){
            try{
                res = Math.multiplyExact(res,arr[i]);
            }
            catch (Exception e){
                res = -1;
                break;
            }
            if (res>1000000000000000000L){
                res=-1;
                break;
            }
            if(res==0){
                break;
            }

        }
        System.out.println(res);

    }



} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());

        int N = Integer.parseInt(st.nextToken());
        long[] arr = new long[N];
        st = new StringTokenizer(br.readLine());
        for (int i=0; i<N; i++)
            arr[i] = Long.parseLong(st.nextToken());
        Arrays.sort(arr);

        long res = 1;
        for (int i=0; i<N; i++){
            try{
                res = Math.multiplyExact(res,arr[i]);
            }
            catch (Exception e){
                res = -1;
                break;
            }
            if (res>1000000000000000000L){
                res=-1;
                break;
            }
            if(res==0){
                break;
            }

        }
        System.out.println(res);

    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());

        int N = Integer.parseInt(st.nextToken());
        long[] arr = new long[N];
        st = new StringTokenizer(br.readLine());
        for (int i=0; i<N; i++)
            arr[i] = Long.parseLong(st.nextToken());
        Arrays.sort(arr);

        long res = 1;
        for (int i=0; i<N; i++){
            try{
                res = Math.multiplyExact(res,arr[i]);
            }
            catch (Exception e){
                res = -1;
                break;
            }
            if (res>1000000000000000000L){
                res=-1;
                break;
            }
            if(res==0){
                break;
            }

        }
        System.out.println(res);

    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringTokenizer st = new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) int N = Integer.parseInt(st.nextToken()); N Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st long[] arr = new long[N]; arr new long[N] N st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) for (int i=0; i<N; i++)
            arr[i] = Long.parseLong(st.nextToken()); int i=0; int i=0; i 0 i<N i N i++ i++ i arr[i] = Long.parseLong(st.nextToken()); arr[i] = Long.parseLong(st.nextToken()) arr[i] arr i Long.parseLong(st.nextToken()) Long.parseLong Long st.nextToken() st.nextToken st Arrays.sort(arr) Arrays.sort Arrays arr long res = 1; res 1 for (int i=0; i<N; i++){
            try{
                res = Math.multiplyExact(res,arr[i]);
            }
            catch (Exception e){
                res = -1;
                break;
            }
            if (res>1000000000000000000L){
                res=-1;
                break;
            }
            if(res==0){
                break;
            }

        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            try{
                res = Math.multiplyExact(res,arr[i]);
            }
            catch (Exception e){
                res = -1;
                break;
            }
            if (res>1000000000000000000L){
                res=-1;
                break;
            }
            if(res==0){
                break;
            }

        } {
            try{
                res = Math.multiplyExact(res,arr[i]);
            }
            catch (Exception e){
                res = -1;
                break;
            }
            if (res>1000000000000000000L){
                res=-1;
                break;
            }
            if(res==0){
                break;
            }

        } try{
                res = Math.multiplyExact(res,arr[i]);
            }
            catch (Exception e){
                res = -1;
                break;
            } catch (Exception e){
                res = -1;
                break;
            } Exception e {
                res = -1;
                break;
            } res = -1 res -1 1 break; {
                res = Math.multiplyExact(res,arr[i]);
            } res = Math.multiplyExact(res,arr[i]) res Math.multiplyExact(res,arr[i]) Math.multiplyExact Math res arr[i] arr i if (res>1000000000000000000L){
                res=-1;
                break;
            } res>1000000000000000000L res 1000000000000000000L {
                res=-1;
                break;
            } res=-1 res -1 1 break; if(res==0){
                break;
            } res==0 res 0 {
                break;
            } break; System.out.println(res) System.out.println System.out System System.out res String[] args args

import java.io.*;
import java.util.*;

class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());

        int N = Integer.parseInt(st.nextToken());
        long[] arr = new long[N];
        st = new StringTokenizer(br.readLine());
        for (int i=0; i<N; i++)
            arr[i] = Long.parseLong(st.nextToken());
        Arrays.sort(arr);

        long res = 1;
        for (int i=0; i<N; i++){
            try{
                res = Math.multiplyExact(res,arr[i]);
            }
            catch (Exception e){
                res = -1;
                break;
            }
            if (res>1000000000000000000L){
                res=-1;
                break;
            }
            if(res==0){
                break;
            }

        }
        System.out.println(res);

    }



}
