import java.math.BigDecimal;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        BigDecimal max = new BigDecimal(Math.pow(10, 18));
        BigDecimal decimal = null;
        boolean overflow = false;

        for (int i = 0; i < n; i++) {
            long val = scanner.nextLong();
            if (val == 0) {
                System.out.println("0");
                System.exit(0);
            }
            if (decimal == null) {
                decimal = new BigDecimal(val);
            } else if (!overflow) {
                decimal = decimal.multiply(new BigDecimal(val));
                if (decimal.compareTo(max) > 0) {
                    overflow = true;
                }
            }
        }

        if (overflow) {
            System.out.println("-1");
        } else {
            System.out.println(decimal);
        }

    }
} import java.math.BigDecimal; BigDecimal java.math import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        BigDecimal max = new BigDecimal(Math.pow(10, 18));
        BigDecimal decimal = null;
        boolean overflow = false;

        for (int i = 0; i < n; i++) {
            long val = scanner.nextLong();
            if (val == 0) {
                System.out.println("0");
                System.exit(0);
            }
            if (decimal == null) {
                decimal = new BigDecimal(val);
            } else if (!overflow) {
                decimal = decimal.multiply(new BigDecimal(val));
                if (decimal.compareTo(max) > 0) {
                    overflow = true;
                }
            }
        }

        if (overflow) {
            System.out.println("-1");
        } else {
            System.out.println(decimal);
        }

    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        BigDecimal max = new BigDecimal(Math.pow(10, 18));
        BigDecimal decimal = null;
        boolean overflow = false;

        for (int i = 0; i < n; i++) {
            long val = scanner.nextLong();
            if (val == 0) {
                System.out.println("0");
                System.exit(0);
            }
            if (decimal == null) {
                decimal = new BigDecimal(val);
            } else if (!overflow) {
                decimal = decimal.multiply(new BigDecimal(val));
                if (decimal.compareTo(max) > 0) {
                    overflow = true;
                }
            }
        }

        if (overflow) {
            System.out.println("-1");
        } else {
            System.out.println(decimal);
        }

    } main {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        BigDecimal max = new BigDecimal(Math.pow(10, 18));
        BigDecimal decimal = null;
        boolean overflow = false;

        for (int i = 0; i < n; i++) {
            long val = scanner.nextLong();
            if (val == 0) {
                System.out.println("0");
                System.exit(0);
            }
            if (decimal == null) {
                decimal = new BigDecimal(val);
            } else if (!overflow) {
                decimal = decimal.multiply(new BigDecimal(val));
                if (decimal.compareTo(max) > 0) {
                    overflow = true;
                }
            }
        }

        if (overflow) {
            System.out.println("-1");
        } else {
            System.out.println(decimal);
        }

    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner BigDecimal max = new BigDecimal(Math.pow(10, 18)); max new BigDecimal(Math.pow(10, 18)) BigDecimal decimal = null; decimal null boolean overflow = false; overflow false for (int i = 0; i < n; i++) {
            long val = scanner.nextLong();
            if (val == 0) {
                System.out.println("0");
                System.exit(0);
            }
            if (decimal == null) {
                decimal = new BigDecimal(val);
            } else if (!overflow) {
                decimal = decimal.multiply(new BigDecimal(val));
                if (decimal.compareTo(max) > 0) {
                    overflow = true;
                }
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            long val = scanner.nextLong();
            if (val == 0) {
                System.out.println("0");
                System.exit(0);
            }
            if (decimal == null) {
                decimal = new BigDecimal(val);
            } else if (!overflow) {
                decimal = decimal.multiply(new BigDecimal(val));
                if (decimal.compareTo(max) > 0) {
                    overflow = true;
                }
            }
        } {
            long val = scanner.nextLong();
            if (val == 0) {
                System.out.println("0");
                System.exit(0);
            }
            if (decimal == null) {
                decimal = new BigDecimal(val);
            } else if (!overflow) {
                decimal = decimal.multiply(new BigDecimal(val));
                if (decimal.compareTo(max) > 0) {
                    overflow = true;
                }
            }
        } long val = scanner.nextLong(); val scanner.nextLong() scanner.nextLong scanner if (val == 0) {
                System.out.println("0");
                System.exit(0);
            } val == 0 val 0 {
                System.out.println("0");
                System.exit(0);
            } System.out.println("0") System.out.println System.out System System.out "0" System.exit(0) System.exit System 0 if (decimal == null) {
                decimal = new BigDecimal(val);
            } else if (!overflow) {
                decimal = decimal.multiply(new BigDecimal(val));
                if (decimal.compareTo(max) > 0) {
                    overflow = true;
                }
            } decimal == null decimal null {
                decimal = new BigDecimal(val);
            } decimal = new BigDecimal(val) decimal new BigDecimal(val) if (!overflow) {
                decimal = decimal.multiply(new BigDecimal(val));
                if (decimal.compareTo(max) > 0) {
                    overflow = true;
                }
            } !overflow overflow {
                decimal = decimal.multiply(new BigDecimal(val));
                if (decimal.compareTo(max) > 0) {
                    overflow = true;
                }
            } decimal = decimal.multiply(new BigDecimal(val)) decimal decimal.multiply(new BigDecimal(val)) decimal.multiply decimal new BigDecimal(val) if (decimal.compareTo(max) > 0) {
                    overflow = true;
                } decimal.compareTo(max) > 0 decimal.compareTo(max) decimal.compareTo decimal max 0 {
                    overflow = true;
                } overflow = true overflow true if (overflow) {
            System.out.println("-1");
        } else {
            System.out.println(decimal);
        } overflow {
            System.out.println("-1");
        } System.out.println("-1") System.out.println System.out System System.out "-1" {
            System.out.println(decimal);
        } System.out.println(decimal) System.out.println System.out System System.out decimal String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        BigDecimal max = new BigDecimal(Math.pow(10, 18));
        BigDecimal decimal = null;
        boolean overflow = false;

        for (int i = 0; i < n; i++) {
            long val = scanner.nextLong();
            if (val == 0) {
                System.out.println("0");
                System.exit(0);
            }
            if (decimal == null) {
                decimal = new BigDecimal(val);
            } else if (!overflow) {
                decimal = decimal.multiply(new BigDecimal(val));
                if (decimal.compareTo(max) > 0) {
                    overflow = true;
                }
            }
        }

        if (overflow) {
            System.out.println("-1");
        } else {
            System.out.println(decimal);
        }

    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        BigDecimal max = new BigDecimal(Math.pow(10, 18));
        BigDecimal decimal = null;
        boolean overflow = false;

        for (int i = 0; i < n; i++) {
            long val = scanner.nextLong();
            if (val == 0) {
                System.out.println("0");
                System.exit(0);
            }
            if (decimal == null) {
                decimal = new BigDecimal(val);
            } else if (!overflow) {
                decimal = decimal.multiply(new BigDecimal(val));
                if (decimal.compareTo(max) > 0) {
                    overflow = true;
                }
            }
        }

        if (overflow) {
            System.out.println("-1");
        } else {
            System.out.println(decimal);
        }

    }
} Main
import java.math.BigDecimal;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        BigDecimal max = new BigDecimal(Math.pow(10, 18));
        BigDecimal decimal = null;
        boolean overflow = false;

        for (int i = 0; i < n; i++) {
            long val = scanner.nextLong();
            if (val == 0) {
                System.out.println("0");
                System.exit(0);
            }
            if (decimal == null) {
                decimal = new BigDecimal(val);
            } else if (!overflow) {
                decimal = decimal.multiply(new BigDecimal(val));
                if (decimal.compareTo(max) > 0) {
                    overflow = true;
                }
            }
        }

        if (overflow) {
            System.out.println("-1");
        } else {
            System.out.println(decimal);
        }

    }
}