import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        List<BigDecimal> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            String value = sc.next();
            if("0".equals(value)) {
                System.out.println("0");
                return;
            } else {
                list.add(new BigDecimal(value));
            }

        }
        BigDecimal x = BigDecimal.valueOf(Math.pow(10, 18));
        BigDecimal result = BigDecimal.valueOf(1);
        for (BigDecimal decimal : list) {
            if (result.compareTo(x) > 0) {
                break;
            } else {
                result = result.multiply(decimal);
            }
        }
        if (result.compareTo(x) > 0) {
            System.out.println("-1");
        } else {
            System.out.println(result.stripTrailingZeros().toPlainString());
        }
    }
} import java.math.BigDecimal; BigDecimal java.math import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util import java.util.stream.Collectors; Collectors java.util.stream import java.util.stream.IntStream; IntStream java.util.stream public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        List<BigDecimal> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            String value = sc.next();
            if("0".equals(value)) {
                System.out.println("0");
                return;
            } else {
                list.add(new BigDecimal(value));
            }

        }
        BigDecimal x = BigDecimal.valueOf(Math.pow(10, 18));
        BigDecimal result = BigDecimal.valueOf(1);
        for (BigDecimal decimal : list) {
            if (result.compareTo(x) > 0) {
                break;
            } else {
                result = result.multiply(decimal);
            }
        }
        if (result.compareTo(x) > 0) {
            System.out.println("-1");
        } else {
            System.out.println(result.stripTrailingZeros().toPlainString());
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        List<BigDecimal> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            String value = sc.next();
            if("0".equals(value)) {
                System.out.println("0");
                return;
            } else {
                list.add(new BigDecimal(value));
            }

        }
        BigDecimal x = BigDecimal.valueOf(Math.pow(10, 18));
        BigDecimal result = BigDecimal.valueOf(1);
        for (BigDecimal decimal : list) {
            if (result.compareTo(x) > 0) {
                break;
            } else {
                result = result.multiply(decimal);
            }
        }
        if (result.compareTo(x) > 0) {
            System.out.println("-1");
        } else {
            System.out.println(result.stripTrailingZeros().toPlainString());
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        List<BigDecimal> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            String value = sc.next();
            if("0".equals(value)) {
                System.out.println("0");
                return;
            } else {
                list.add(new BigDecimal(value));
            }

        }
        BigDecimal x = BigDecimal.valueOf(Math.pow(10, 18));
        BigDecimal result = BigDecimal.valueOf(1);
        for (BigDecimal decimal : list) {
            if (result.compareTo(x) > 0) {
                break;
            } else {
                result = result.multiply(decimal);
            }
        }
        if (result.compareTo(x) > 0) {
            System.out.println("-1");
        } else {
            System.out.println(result.stripTrailingZeros().toPlainString());
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc sc.nextLine() sc.nextLine sc List<BigDecimal> list = new ArrayList<>(); list new ArrayList<>() for (int i = 0; i < n; i++) {
            String value = sc.next();
            if("0".equals(value)) {
                System.out.println("0");
                return;
            } else {
                list.add(new BigDecimal(value));
            }

        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String value = sc.next();
            if("0".equals(value)) {
                System.out.println("0");
                return;
            } else {
                list.add(new BigDecimal(value));
            }

        } {
            String value = sc.next();
            if("0".equals(value)) {
                System.out.println("0");
                return;
            } else {
                list.add(new BigDecimal(value));
            }

        } String value = sc.next(); value sc.next() sc.next sc if("0".equals(value)) {
                System.out.println("0");
                return;
            } else {
                list.add(new BigDecimal(value));
            } "0".equals(value) "0".equals "0" value {
                System.out.println("0");
                return;
            } System.out.println("0") System.out.println System.out System System.out "0" return; {
                list.add(new BigDecimal(value));
            } list.add(new BigDecimal(value)) list.add list new BigDecimal(value) BigDecimal x = BigDecimal.valueOf(Math.pow(10, 18)); x BigDecimal.valueOf(Math.pow(10, 18)) BigDecimal.valueOf BigDecimal Math.pow(10, 18) Math.pow Math 10 18 BigDecimal result = BigDecimal.valueOf(1); result BigDecimal.valueOf(1) BigDecimal.valueOf BigDecimal 1 for (BigDecimal decimal : list) {
            if (result.compareTo(x) > 0) {
                break;
            } else {
                result = result.multiply(decimal);
            }
        } BigDecimal decimal list {
            if (result.compareTo(x) > 0) {
                break;
            } else {
                result = result.multiply(decimal);
            }
        } {
            if (result.compareTo(x) > 0) {
                break;
            } else {
                result = result.multiply(decimal);
            }
        } if (result.compareTo(x) > 0) {
                break;
            } else {
                result = result.multiply(decimal);
            } result.compareTo(x) > 0 result.compareTo(x) result.compareTo result x 0 {
                break;
            } break; {
                result = result.multiply(decimal);
            } result = result.multiply(decimal) result result.multiply(decimal) result.multiply result decimal if (result.compareTo(x) > 0) {
            System.out.println("-1");
        } else {
            System.out.println(result.stripTrailingZeros().toPlainString());
        } result.compareTo(x) > 0 result.compareTo(x) result.compareTo result x 0 {
            System.out.println("-1");
        } System.out.println("-1") System.out.println System.out System System.out "-1" {
            System.out.println(result.stripTrailingZeros().toPlainString());
        } System.out.println(result.stripTrailingZeros().toPlainString()) System.out.println System.out System System.out result.stripTrailingZeros().toPlainString() result.stripTrailingZeros().toPlainString result.stripTrailingZeros() result.stripTrailingZeros result String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        List<BigDecimal> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            String value = sc.next();
            if("0".equals(value)) {
                System.out.println("0");
                return;
            } else {
                list.add(new BigDecimal(value));
            }

        }
        BigDecimal x = BigDecimal.valueOf(Math.pow(10, 18));
        BigDecimal result = BigDecimal.valueOf(1);
        for (BigDecimal decimal : list) {
            if (result.compareTo(x) > 0) {
                break;
            } else {
                result = result.multiply(decimal);
            }
        }
        if (result.compareTo(x) > 0) {
            System.out.println("-1");
        } else {
            System.out.println(result.stripTrailingZeros().toPlainString());
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        List<BigDecimal> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            String value = sc.next();
            if("0".equals(value)) {
                System.out.println("0");
                return;
            } else {
                list.add(new BigDecimal(value));
            }

        }
        BigDecimal x = BigDecimal.valueOf(Math.pow(10, 18));
        BigDecimal result = BigDecimal.valueOf(1);
        for (BigDecimal decimal : list) {
            if (result.compareTo(x) > 0) {
                break;
            } else {
                result = result.multiply(decimal);
            }
        }
        if (result.compareTo(x) > 0) {
            System.out.println("-1");
        } else {
            System.out.println(result.stripTrailingZeros().toPlainString());
        }
    }
} Main
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        List<BigDecimal> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            String value = sc.next();
            if("0".equals(value)) {
                System.out.println("0");
                return;
            } else {
                list.add(new BigDecimal(value));
            }

        }
        BigDecimal x = BigDecimal.valueOf(Math.pow(10, 18));
        BigDecimal result = BigDecimal.valueOf(1);
        for (BigDecimal decimal : list) {
            if (result.compareTo(x) > 0) {
                break;
            } else {
                result = result.multiply(decimal);
            }
        }
        if (result.compareTo(x) > 0) {
            System.out.println("-1");
        } else {
            System.out.println(result.stripTrailingZeros().toPlainString());
        }
    }
}
