
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        long max = 1_000_000_000_000_000_000L;
        long root = 3037000499L;
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = in.nextInt();
        long ans = 1;

        if (N == 0) {
            System.out.println(0);
            return;
        }

        //System.out.println(max * max);

        List<Long> list = new ArrayList<>();
        for (int i = 0; i < N; ++i) {
            long a = in.nextLong();
            if (a > max) {
                System.out.println(-1);
                return;
            }

            if (a == 0) {
                System.out.println(0);
                return;
            }

            list.add(a);

        }

        for (long a : list) {
            if (ans > root && a > root) {
                System.out.println(-1);
                return;
            }
            ans *= a;

            if (ans < 0 || ans > max) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(ans);
        in.close();
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        long max = 1_000_000_000_000_000_000L;
        long root = 3037000499L;
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = in.nextInt();
        long ans = 1;

        if (N == 0) {
            System.out.println(0);
            return;
        }

        //System.out.println(max * max);

        List<Long> list = new ArrayList<>();
        for (int i = 0; i < N; ++i) {
            long a = in.nextLong();
            if (a > max) {
                System.out.println(-1);
                return;
            }

            if (a == 0) {
                System.out.println(0);
                return;
            }

            list.add(a);

        }

        for (long a : list) {
            if (ans > root && a > root) {
                System.out.println(-1);
                return;
            }
            ans *= a;

            if (ans < 0 || ans > max) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(ans);
        in.close();
    }
} Main public static void main(String[] args) {
        long max = 1_000_000_000_000_000_000L;
        long root = 3037000499L;
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = in.nextInt();
        long ans = 1;

        if (N == 0) {
            System.out.println(0);
            return;
        }

        //System.out.println(max * max);

        List<Long> list = new ArrayList<>();
        for (int i = 0; i < N; ++i) {
            long a = in.nextLong();
            if (a > max) {
                System.out.println(-1);
                return;
            }

            if (a == 0) {
                System.out.println(0);
                return;
            }

            list.add(a);

        }

        for (long a : list) {
            if (ans > root && a > root) {
                System.out.println(-1);
                return;
            }
            ans *= a;

            if (ans < 0 || ans > max) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(ans);
        in.close();
    } main {
        long max = 1_000_000_000_000_000_000L;
        long root = 3037000499L;
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = in.nextInt();
        long ans = 1;

        if (N == 0) {
            System.out.println(0);
            return;
        }

        //System.out.println(max * max);

        List<Long> list = new ArrayList<>();
        for (int i = 0; i < N; ++i) {
            long a = in.nextLong();
            if (a > max) {
                System.out.println(-1);
                return;
            }

            if (a == 0) {
                System.out.println(0);
                return;
            }

            list.add(a);

        }

        for (long a : list) {
            if (ans > root && a > root) {
                System.out.println(-1);
                return;
            }
            ans *= a;

            if (ans < 0 || ans > max) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(ans);
        in.close();
    } long max = 1_000_000_000_000_000_000L; max 1_000_000_000_000_000_000L long root = 3037000499L; root 3037000499L Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); in new Scanner(new BufferedReader(new InputStreamReader(System.in))) int N = in.nextInt(); N in.nextInt() in.nextInt in long ans = 1; ans 1 if (N == 0) {
            System.out.println(0);
            return;
        } N == 0 N 0 {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; List<Long> list = new ArrayList<>(); list new ArrayList<>() for (int i = 0; i < N; ++i) {
            long a = in.nextLong();
            if (a > max) {
                System.out.println(-1);
                return;
            }

            if (a == 0) {
                System.out.println(0);
                return;
            }

            list.add(a);

        } int i = 0; int i = 0; i 0 i < N i N ++i ++i i {
            long a = in.nextLong();
            if (a > max) {
                System.out.println(-1);
                return;
            }

            if (a == 0) {
                System.out.println(0);
                return;
            }

            list.add(a);

        } {
            long a = in.nextLong();
            if (a > max) {
                System.out.println(-1);
                return;
            }

            if (a == 0) {
                System.out.println(0);
                return;
            }

            list.add(a);

        } long a = in.nextLong(); a in.nextLong() in.nextLong in if (a > max) {
                System.out.println(-1);
                return;
            } a > max a max {
                System.out.println(-1);
                return;
            } System.out.println(-1) System.out.println System.out System System.out -1 1 return; if (a == 0) {
                System.out.println(0);
                return;
            } a == 0 a 0 {
                System.out.println(0);
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; list.add(a) list.add list a for (long a : list) {
            if (ans > root && a > root) {
                System.out.println(-1);
                return;
            }
            ans *= a;

            if (ans < 0 || ans > max) {
                System.out.println(-1);
                return;
            }
        } long a list {
            if (ans > root && a > root) {
                System.out.println(-1);
                return;
            }
            ans *= a;

            if (ans < 0 || ans > max) {
                System.out.println(-1);
                return;
            }
        } {
            if (ans > root && a > root) {
                System.out.println(-1);
                return;
            }
            ans *= a;

            if (ans < 0 || ans > max) {
                System.out.println(-1);
                return;
            }
        } if (ans > root && a > root) {
                System.out.println(-1);
                return;
            } ans > root && a > root ans > root ans root a > root a root {
                System.out.println(-1);
                return;
            } System.out.println(-1) System.out.println System.out System System.out -1 1 return; ans *= a ans a if (ans < 0 || ans > max) {
                System.out.println(-1);
                return;
            } ans < 0 || ans > max ans < 0 ans 0 ans > max ans max {
                System.out.println(-1);
                return;
            } System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(ans) System.out.println System.out System System.out ans in.close() in.close in String[] args args public class Main {
    public static void main(String[] args) {
        long max = 1_000_000_000_000_000_000L;
        long root = 3037000499L;
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = in.nextInt();
        long ans = 1;

        if (N == 0) {
            System.out.println(0);
            return;
        }

        //System.out.println(max * max);

        List<Long> list = new ArrayList<>();
        for (int i = 0; i < N; ++i) {
            long a = in.nextLong();
            if (a > max) {
                System.out.println(-1);
                return;
            }

            if (a == 0) {
                System.out.println(0);
                return;
            }

            list.add(a);

        }

        for (long a : list) {
            if (ans > root && a > root) {
                System.out.println(-1);
                return;
            }
            ans *= a;

            if (ans < 0 || ans > max) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(ans);
        in.close();
    }
} public class Main {
    public static void main(String[] args) {
        long max = 1_000_000_000_000_000_000L;
        long root = 3037000499L;
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = in.nextInt();
        long ans = 1;

        if (N == 0) {
            System.out.println(0);
            return;
        }

        //System.out.println(max * max);

        List<Long> list = new ArrayList<>();
        for (int i = 0; i < N; ++i) {
            long a = in.nextLong();
            if (a > max) {
                System.out.println(-1);
                return;
            }

            if (a == 0) {
                System.out.println(0);
                return;
            }

            list.add(a);

        }

        for (long a : list) {
            if (ans > root && a > root) {
                System.out.println(-1);
                return;
            }
            ans *= a;

            if (ans < 0 || ans > max) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(ans);
        in.close();
    }
} Main

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        long max = 1_000_000_000_000_000_000L;
        long root = 3037000499L;
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = in.nextInt();
        long ans = 1;

        if (N == 0) {
            System.out.println(0);
            return;
        }

        //System.out.println(max * max);

        List<Long> list = new ArrayList<>();
        for (int i = 0; i < N; ++i) {
            long a = in.nextLong();
            if (a > max) {
                System.out.println(-1);
                return;
            }

            if (a == 0) {
                System.out.println(0);
                return;
            }

            list.add(a);

        }

        for (long a : list) {
            if (ans > root && a > root) {
                System.out.println(-1);
                return;
            }
            ans *= a;

            if (ans < 0 || ans > max) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(ans);
        in.close();
    }
}