import java.io.*;
import java.math.BigInteger;
import java.util.*;

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

        int n = Integer.parseInt(br.readLine());

        BigInteger prod = new BigInteger("1");
        StringTokenizer st = new StringTokenizer(br.readLine());

        String[] arr = new String[n];

        for (int i = 0; i < n; i++) {
            arr[i] = (st.nextToken());
            if (arr[i].equals("0")) {
                pw.println("0");
                pw.close();
                return;
            }
        }

        for (String x : arr) {
            prod = prod.multiply(new BigInteger(x));
            if (prod.compareTo(new BigInteger("1000000000000000000")) > 0) {
                pw.println("-1");
                pw.close();
                return;
            }
        }

        pw.println(prod);
        pw.close();
    }
} import java.io.*; io.* java import java.math.BigInteger; BigInteger java.math import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));

        int n = Integer.parseInt(br.readLine());

        BigInteger prod = new BigInteger("1");
        StringTokenizer st = new StringTokenizer(br.readLine());

        String[] arr = new String[n];

        for (int i = 0; i < n; i++) {
            arr[i] = (st.nextToken());
            if (arr[i].equals("0")) {
                pw.println("0");
                pw.close();
                return;
            }
        }

        for (String x : arr) {
            prod = prod.multiply(new BigInteger(x));
            if (prod.compareTo(new BigInteger("1000000000000000000")) > 0) {
                pw.println("-1");
                pw.close();
                return;
            }
        }

        pw.println(prod);
        pw.close();
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));

        int n = Integer.parseInt(br.readLine());

        BigInteger prod = new BigInteger("1");
        StringTokenizer st = new StringTokenizer(br.readLine());

        String[] arr = new String[n];

        for (int i = 0; i < n; i++) {
            arr[i] = (st.nextToken());
            if (arr[i].equals("0")) {
                pw.println("0");
                pw.close();
                return;
            }
        }

        for (String x : arr) {
            prod = prod.multiply(new BigInteger(x));
            if (prod.compareTo(new BigInteger("1000000000000000000")) > 0) {
                pw.println("-1");
                pw.close();
                return;
            }
        }

        pw.println(prod);
        pw.close();
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));

        int n = Integer.parseInt(br.readLine());

        BigInteger prod = new BigInteger("1");
        StringTokenizer st = new StringTokenizer(br.readLine());

        String[] arr = new String[n];

        for (int i = 0; i < n; i++) {
            arr[i] = (st.nextToken());
            if (arr[i].equals("0")) {
                pw.println("0");
                pw.close();
                return;
            }
        }

        for (String x : arr) {
            prod = prod.multiply(new BigInteger(x));
            if (prod.compareTo(new BigInteger("1000000000000000000")) > 0) {
                pw.println("-1");
                pw.close();
                return;
            }
        }

        pw.println(prod);
        pw.close();
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out)); pw new PrintWriter(new OutputStreamWriter(System.out)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br BigInteger prod = new BigInteger("1"); prod new BigInteger("1") StringTokenizer st = new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) String[] arr = new String[n]; arr new String[n] n for (int i = 0; i < n; i++) {
            arr[i] = (st.nextToken());
            if (arr[i].equals("0")) {
                pw.println("0");
                pw.close();
                return;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            arr[i] = (st.nextToken());
            if (arr[i].equals("0")) {
                pw.println("0");
                pw.close();
                return;
            }
        } {
            arr[i] = (st.nextToken());
            if (arr[i].equals("0")) {
                pw.println("0");
                pw.close();
                return;
            }
        } arr[i] = (st.nextToken()) arr[i] arr i (st.nextToken()) st.nextToken st if (arr[i].equals("0")) {
                pw.println("0");
                pw.close();
                return;
            } arr[i].equals("0") arr[i].equals arr[i] arr i "0" {
                pw.println("0");
                pw.close();
                return;
            } pw.println("0") pw.println pw "0" pw.close() pw.close pw return; for (String x : arr) {
            prod = prod.multiply(new BigInteger(x));
            if (prod.compareTo(new BigInteger("1000000000000000000")) > 0) {
                pw.println("-1");
                pw.close();
                return;
            }
        } String x arr {
            prod = prod.multiply(new BigInteger(x));
            if (prod.compareTo(new BigInteger("1000000000000000000")) > 0) {
                pw.println("-1");
                pw.close();
                return;
            }
        } {
            prod = prod.multiply(new BigInteger(x));
            if (prod.compareTo(new BigInteger("1000000000000000000")) > 0) {
                pw.println("-1");
                pw.close();
                return;
            }
        } prod = prod.multiply(new BigInteger(x)) prod prod.multiply(new BigInteger(x)) prod.multiply prod new BigInteger(x) if (prod.compareTo(new BigInteger("1000000000000000000")) > 0) {
                pw.println("-1");
                pw.close();
                return;
            } prod.compareTo(new BigInteger("1000000000000000000")) > 0 prod.compareTo(new BigInteger("1000000000000000000")) prod.compareTo prod new BigInteger("1000000000000000000") 0 {
                pw.println("-1");
                pw.close();
                return;
            } pw.println("-1") pw.println pw "-1" pw.close() pw.close pw return; pw.println(prod) pw.println pw prod pw.close() pw.close pw String[] args args public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));

        int n = Integer.parseInt(br.readLine());

        BigInteger prod = new BigInteger("1");
        StringTokenizer st = new StringTokenizer(br.readLine());

        String[] arr = new String[n];

        for (int i = 0; i < n; i++) {
            arr[i] = (st.nextToken());
            if (arr[i].equals("0")) {
                pw.println("0");
                pw.close();
                return;
            }
        }

        for (String x : arr) {
            prod = prod.multiply(new BigInteger(x));
            if (prod.compareTo(new BigInteger("1000000000000000000")) > 0) {
                pw.println("-1");
                pw.close();
                return;
            }
        }

        pw.println(prod);
        pw.close();
    }
} public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));

        int n = Integer.parseInt(br.readLine());

        BigInteger prod = new BigInteger("1");
        StringTokenizer st = new StringTokenizer(br.readLine());

        String[] arr = new String[n];

        for (int i = 0; i < n; i++) {
            arr[i] = (st.nextToken());
            if (arr[i].equals("0")) {
                pw.println("0");
                pw.close();
                return;
            }
        }

        for (String x : arr) {
            prod = prod.multiply(new BigInteger(x));
            if (prod.compareTo(new BigInteger("1000000000000000000")) > 0) {
                pw.println("-1");
                pw.close();
                return;
            }
        }

        pw.println(prod);
        pw.close();
    }
} Main
import java.io.*;
import java.math.BigInteger;
import java.util.*;

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

        int n = Integer.parseInt(br.readLine());

        BigInteger prod = new BigInteger("1");
        StringTokenizer st = new StringTokenizer(br.readLine());

        String[] arr = new String[n];

        for (int i = 0; i < n; i++) {
            arr[i] = (st.nextToken());
            if (arr[i].equals("0")) {
                pw.println("0");
                pw.close();
                return;
            }
        }

        for (String x : arr) {
            prod = prod.multiply(new BigInteger(x));
            if (prod.compareTo(new BigInteger("1000000000000000000")) > 0) {
                pw.println("-1");
                pw.close();
                return;
            }
        }

        pw.println(prod);
        pw.close();
    }
}
