import java.util.*;

class Main {
    final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    private void run() {
        int n = sc.nextInt();

        long a = sc.nextLong();
        boolean over = false;
        for (int i = 1; i < n; i++) {
            long m = sc.nextLong();
            if (m == 0) {
                System.out.println(0);
                return;
            }

            if (Math.log10(a) + Math.log10(m) > 18) {
                over = true;
            }
            a *= m;
        }
        if (over || a > 1000000000000000000L) {
            System.out.println(-1);
            return;
        }
        System.out.println(a);
    }
} import java.util.*; util.* java class Main {
    final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    private void run() {
        int n = sc.nextInt();

        long a = sc.nextLong();
        boolean over = false;
        for (int i = 1; i < n; i++) {
            long m = sc.nextLong();
            if (m == 0) {
                System.out.println(0);
                return;
            }

            if (Math.log10(a) + Math.log10(m) > 18) {
                over = true;
            }
            a *= m;
        }
        if (over || a > 1000000000000000000L) {
            System.out.println(-1);
            return;
        }
        System.out.println(a);
    }
} Main final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args private void run() {
        int n = sc.nextInt();

        long a = sc.nextLong();
        boolean over = false;
        for (int i = 1; i < n; i++) {
            long m = sc.nextLong();
            if (m == 0) {
                System.out.println(0);
                return;
            }

            if (Math.log10(a) + Math.log10(m) > 18) {
                over = true;
            }
            a *= m;
        }
        if (over || a > 1000000000000000000L) {
            System.out.println(-1);
            return;
        }
        System.out.println(a);
    } run {
        int n = sc.nextInt();

        long a = sc.nextLong();
        boolean over = false;
        for (int i = 1; i < n; i++) {
            long m = sc.nextLong();
            if (m == 0) {
                System.out.println(0);
                return;
            }

            if (Math.log10(a) + Math.log10(m) > 18) {
                over = true;
            }
            a *= m;
        }
        if (over || a > 1000000000000000000L) {
            System.out.println(-1);
            return;
        }
        System.out.println(a);
    } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc boolean over = false; over false for (int i = 1; i < n; i++) {
            long m = sc.nextLong();
            if (m == 0) {
                System.out.println(0);
                return;
            }

            if (Math.log10(a) + Math.log10(m) > 18) {
                over = true;
            }
            a *= m;
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            long m = sc.nextLong();
            if (m == 0) {
                System.out.println(0);
                return;
            }

            if (Math.log10(a) + Math.log10(m) > 18) {
                over = true;
            }
            a *= m;
        } {
            long m = sc.nextLong();
            if (m == 0) {
                System.out.println(0);
                return;
            }

            if (Math.log10(a) + Math.log10(m) > 18) {
                over = true;
            }
            a *= m;
        } long m = sc.nextLong(); m sc.nextLong() sc.nextLong sc if (m == 0) {
                System.out.println(0);
                return;
            } m == 0 m 0 {
                System.out.println(0);
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; if (Math.log10(a) + Math.log10(m) > 18) {
                over = true;
            } Math.log10(a) + Math.log10(m) > 18 Math.log10(a) + Math.log10(m) Math.log10(a) Math.log10 Math a Math.log10(m) Math.log10 Math m 18 {
                over = true;
            } over = true over true a *= m a m if (over || a > 1000000000000000000L) {
            System.out.println(-1);
            return;
        } over || a > 1000000000000000000L over a > 1000000000000000000L a 1000000000000000000L {
            System.out.println(-1);
            return;
        } System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(a) System.out.println System.out System System.out a
import java.util.*;

class Main {
    final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    private void run() {
        int n = sc.nextInt();

        long a = sc.nextLong();
        boolean over = false;
        for (int i = 1; i < n; i++) {
            long m = sc.nextLong();
            if (m == 0) {
                System.out.println(0);
                return;
            }

            if (Math.log10(a) + Math.log10(m) > 18) {
                over = true;
            }
            a *= m;
        }
        if (over || a > 1000000000000000000L) {
            System.out.println(-1);
            return;
        }
        System.out.println(a);
    }
}
