import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

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

        int N = Integer.parseInt(st.nextToken());
        String[] str_array = br.readLine().split(" ");

        long ans = 1;
        long cut = Long.parseLong("1000000000000000000");

        Arrays.sort(str_array);

        for(String str : str_array) {

            if("0".equals(str)) {
                pw.println(0);
                pw.close();
                return;
            }

            if(ans > cut / Long.parseLong(str)) {
                pw.println(-1);
                pw.close();
                return;
            }
            ans *= Long.parseLong(str);
        }

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

        int N = Integer.parseInt(st.nextToken());
        String[] str_array = br.readLine().split(" ");

        long ans = 1;
        long cut = Long.parseLong("1000000000000000000");

        Arrays.sort(str_array);

        for(String str : str_array) {

            if("0".equals(str)) {
                pw.println(0);
                pw.close();
                return;
            }

            if(ans > cut / Long.parseLong(str)) {
                pw.println(-1);
                pw.close();
                return;
            }
            ans *= Long.parseLong(str);
        }

        pw.println(ans);
        br.close();
        pw.close();
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        StringTokenizer st = new StringTokenizer(br.readLine());

        int N = Integer.parseInt(st.nextToken());
        String[] str_array = br.readLine().split(" ");

        long ans = 1;
        long cut = Long.parseLong("1000000000000000000");

        Arrays.sort(str_array);

        for(String str : str_array) {

            if("0".equals(str)) {
                pw.println(0);
                pw.close();
                return;
            }

            if(ans > cut / Long.parseLong(str)) {
                pw.println(-1);
                pw.close();
                return;
            }
            ans *= Long.parseLong(str);
        }

        pw.println(ans);
        br.close();
        pw.close();
    } main {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        StringTokenizer st = new StringTokenizer(br.readLine());

        int N = Integer.parseInt(st.nextToken());
        String[] str_array = br.readLine().split(" ");

        long ans = 1;
        long cut = Long.parseLong("1000000000000000000");

        Arrays.sort(str_array);

        for(String str : str_array) {

            if("0".equals(str)) {
                pw.println(0);
                pw.close();
                return;
            }

            if(ans > cut / Long.parseLong(str)) {
                pw.println(-1);
                pw.close();
                return;
            }
            ans *= Long.parseLong(str);
        }

        pw.println(ans);
        br.close();
        pw.close();
    } BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in)); br new BufferedReader(new java.io.InputStreamReader(System.in)) PrintWriter pw = new PrintWriter(System.out); pw new PrintWriter(System.out) 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 String[] str_array = br.readLine().split(" "); str_array br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long ans = 1; ans 1 long cut = Long.parseLong("1000000000000000000"); cut Long.parseLong("1000000000000000000") Long.parseLong Long "1000000000000000000" Arrays.sort(str_array) Arrays.sort Arrays str_array for(String str : str_array) {

            if("0".equals(str)) {
                pw.println(0);
                pw.close();
                return;
            }

            if(ans > cut / Long.parseLong(str)) {
                pw.println(-1);
                pw.close();
                return;
            }
            ans *= Long.parseLong(str);
        } String str str_array {

            if("0".equals(str)) {
                pw.println(0);
                pw.close();
                return;
            }

            if(ans > cut / Long.parseLong(str)) {
                pw.println(-1);
                pw.close();
                return;
            }
            ans *= Long.parseLong(str);
        } {

            if("0".equals(str)) {
                pw.println(0);
                pw.close();
                return;
            }

            if(ans > cut / Long.parseLong(str)) {
                pw.println(-1);
                pw.close();
                return;
            }
            ans *= Long.parseLong(str);
        } if("0".equals(str)) {
                pw.println(0);
                pw.close();
                return;
            } "0".equals(str) "0".equals "0" str {
                pw.println(0);
                pw.close();
                return;
            } pw.println(0) pw.println pw 0 pw.close() pw.close pw return; if(ans > cut / Long.parseLong(str)) {
                pw.println(-1);
                pw.close();
                return;
            } ans > cut / Long.parseLong(str) ans cut / Long.parseLong(str) cut Long.parseLong(str) Long.parseLong Long str {
                pw.println(-1);
                pw.close();
                return;
            } pw.println(-1) pw.println pw -1 1 pw.close() pw.close pw return; ans *= Long.parseLong(str) ans Long.parseLong(str) Long.parseLong Long str pw.println(ans) pw.println pw ans br.close() br.close br pw.close() pw.close pw String[] args args public class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        StringTokenizer st = new StringTokenizer(br.readLine());

        int N = Integer.parseInt(st.nextToken());
        String[] str_array = br.readLine().split(" ");

        long ans = 1;
        long cut = Long.parseLong("1000000000000000000");

        Arrays.sort(str_array);

        for(String str : str_array) {

            if("0".equals(str)) {
                pw.println(0);
                pw.close();
                return;
            }

            if(ans > cut / Long.parseLong(str)) {
                pw.println(-1);
                pw.close();
                return;
            }
            ans *= Long.parseLong(str);
        }

        pw.println(ans);
        br.close();
        pw.close();
    }
} public class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        StringTokenizer st = new StringTokenizer(br.readLine());

        int N = Integer.parseInt(st.nextToken());
        String[] str_array = br.readLine().split(" ");

        long ans = 1;
        long cut = Long.parseLong("1000000000000000000");

        Arrays.sort(str_array);

        for(String str : str_array) {

            if("0".equals(str)) {
                pw.println(0);
                pw.close();
                return;
            }

            if(ans > cut / Long.parseLong(str)) {
                pw.println(-1);
                pw.close();
                return;
            }
            ans *= Long.parseLong(str);
        }

        pw.println(ans);
        br.close();
        pw.close();
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

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

        int N = Integer.parseInt(st.nextToken());
        String[] str_array = br.readLine().split(" ");

        long ans = 1;
        long cut = Long.parseLong("1000000000000000000");

        Arrays.sort(str_array);

        for(String str : str_array) {

            if("0".equals(str)) {
                pw.println(0);
                pw.close();
                return;
            }

            if(ans > cut / Long.parseLong(str)) {
                pw.println(-1);
                pw.close();
                return;
            }
            ans *= Long.parseLong(str);
        }

        pw.println(ans);
        br.close();
        pw.close();
    }
}