import java.util.*;

public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        long n = sc.nextInt();
        long k = 1;
        long l = 1;
        for (int i = 0; i < n; i++) {
            l = sc.nextLong();
            if (k == -1) {
                if (l == 0) {
                    k = 0;
                    break;
                } else {
                    continue;
                }
            }
            if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {
                k = -1;
                continue;
            }
            k = l * k;
        }

        sc.close();
        System.out.println(k);
    }
} import java.util.*; util.* java public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        long n = sc.nextInt();
        long k = 1;
        long l = 1;
        for (int i = 0; i < n; i++) {
            l = sc.nextLong();
            if (k == -1) {
                if (l == 0) {
                    k = 0;
                    break;
                } else {
                    continue;
                }
            }
            if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {
                k = -1;
                continue;
            }
            k = l * k;
        }

        sc.close();
        System.out.println(k);
    }
} Main public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        long n = sc.nextInt();
        long k = 1;
        long l = 1;
        for (int i = 0; i < n; i++) {
            l = sc.nextLong();
            if (k == -1) {
                if (l == 0) {
                    k = 0;
                    break;
                } else {
                    continue;
                }
            }
            if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {
                k = -1;
                continue;
            }
            k = l * k;
        }

        sc.close();
        System.out.println(k);
    } main {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        long n = sc.nextInt();
        long k = 1;
        long l = 1;
        for (int i = 0; i < n; i++) {
            l = sc.nextLong();
            if (k == -1) {
                if (l == 0) {
                    k = 0;
                    break;
                } else {
                    continue;
                }
            }
            if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {
                k = -1;
                continue;
            }
            k = l * k;
        }

        sc.close();
        System.out.println(k);
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long k = 1; k 1 long l = 1; l 1 for (int i = 0; i < n; i++) {
            l = sc.nextLong();
            if (k == -1) {
                if (l == 0) {
                    k = 0;
                    break;
                } else {
                    continue;
                }
            }
            if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {
                k = -1;
                continue;
            }
            k = l * k;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            l = sc.nextLong();
            if (k == -1) {
                if (l == 0) {
                    k = 0;
                    break;
                } else {
                    continue;
                }
            }
            if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {
                k = -1;
                continue;
            }
            k = l * k;
        } {
            l = sc.nextLong();
            if (k == -1) {
                if (l == 0) {
                    k = 0;
                    break;
                } else {
                    continue;
                }
            }
            if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {
                k = -1;
                continue;
            }
            k = l * k;
        } l = sc.nextLong() l sc.nextLong() sc.nextLong sc if (k == -1) {
                if (l == 0) {
                    k = 0;
                    break;
                } else {
                    continue;
                }
            } k == -1 k -1 1 {
                if (l == 0) {
                    k = 0;
                    break;
                } else {
                    continue;
                }
            } if (l == 0) {
                    k = 0;
                    break;
                } else {
                    continue;
                } l == 0 l 0 {
                    k = 0;
                    break;
                } k = 0 k 0 break; {
                    continue;
                } continue; if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {
                k = -1;
                continue;
            } Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L Math.log10(k) + Math.log10(l) > 18 Math.log10(k) + Math.log10(l) Math.log10(k) Math.log10 Math k Math.log10(l) Math.log10 Math l 18 l * k > 1000000000000000000L l * k l k 1000000000000000000L {
                k = -1;
                continue;
            } k = -1 k -1 1 continue; k = l * k k l * k l k sc.close() sc.close sc System.out.println(k) System.out.println System.out System System.out k final String[] args args public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        long n = sc.nextInt();
        long k = 1;
        long l = 1;
        for (int i = 0; i < n; i++) {
            l = sc.nextLong();
            if (k == -1) {
                if (l == 0) {
                    k = 0;
                    break;
                } else {
                    continue;
                }
            }
            if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {
                k = -1;
                continue;
            }
            k = l * k;
        }

        sc.close();
        System.out.println(k);
    }
} public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        long n = sc.nextInt();
        long k = 1;
        long l = 1;
        for (int i = 0; i < n; i++) {
            l = sc.nextLong();
            if (k == -1) {
                if (l == 0) {
                    k = 0;
                    break;
                } else {
                    continue;
                }
            }
            if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {
                k = -1;
                continue;
            }
            k = l * k;
        }

        sc.close();
        System.out.println(k);
    }
} Main
import java.util.*;

public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        long n = sc.nextInt();
        long k = 1;
        long l = 1;
        for (int i = 0; i < n; i++) {
            l = sc.nextLong();
            if (k == -1) {
                if (l == 0) {
                    k = 0;
                    break;
                } else {
                    continue;
                }
            }
            if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {
                k = -1;
                continue;
            }
            k = l * k;
        }

        sc.close();
        System.out.println(k);
    }
}