import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        solve(System.in, System.out);
    }

    static void solve(InputStream is, PrintStream os) {
        // Your code here!
        Scanner scan = new Scanner(is);
        int N = scan.nextInt();
        long ans = 1;
        long A[] = new long[N];
        long max = (long)Math.pow(10, 18);

        for(int i = 0; i < N; i++) {
            A[i] = scan.nextLong();
            if(A[i] == 0) {
                os.println(0);
                return;
            }
        }

        for(int i = 0; i < N; i++) {
            if(ans > max/A[i]) {
                os.println(-1);
                return;
            }
            ans *= A[i];
        }
        os.println(ans);

    }
} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        solve(System.in, System.out);
    }

    static void solve(InputStream is, PrintStream os) {
        // Your code here!
        Scanner scan = new Scanner(is);
        int N = scan.nextInt();
        long ans = 1;
        long A[] = new long[N];
        long max = (long)Math.pow(10, 18);

        for(int i = 0; i < N; i++) {
            A[i] = scan.nextLong();
            if(A[i] == 0) {
                os.println(0);
                return;
            }
        }

        for(int i = 0; i < N; i++) {
            if(ans > max/A[i]) {
                os.println(-1);
                return;
            }
            ans *= A[i];
        }
        os.println(ans);

    }
} Main public static void main(String[] args) throws Exception {
        solve(System.in, System.out);
    } main {
        solve(System.in, System.out);
    } solve(System.in, System.out) solve System.in System System.in System.out System System.out String[] args args static void solve(InputStream is, PrintStream os) {
        // Your code here!
        Scanner scan = new Scanner(is);
        int N = scan.nextInt();
        long ans = 1;
        long A[] = new long[N];
        long max = (long)Math.pow(10, 18);

        for(int i = 0; i < N; i++) {
            A[i] = scan.nextLong();
            if(A[i] == 0) {
                os.println(0);
                return;
            }
        }

        for(int i = 0; i < N; i++) {
            if(ans > max/A[i]) {
                os.println(-1);
                return;
            }
            ans *= A[i];
        }
        os.println(ans);

    } solve {
        // Your code here!
        Scanner scan = new Scanner(is);
        int N = scan.nextInt();
        long ans = 1;
        long A[] = new long[N];
        long max = (long)Math.pow(10, 18);

        for(int i = 0; i < N; i++) {
            A[i] = scan.nextLong();
            if(A[i] == 0) {
                os.println(0);
                return;
            }
        }

        for(int i = 0; i < N; i++) {
            if(ans > max/A[i]) {
                os.println(-1);
                return;
            }
            ans *= A[i];
        }
        os.println(ans);

    } Scanner scan = new Scanner(is); scan new Scanner(is) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan long ans = 1; ans 1 long A[] = new long[N]; A new long[N] N long max = (long)Math.pow(10, 18); max (long)Math.pow(10, 18) Math.pow Math 10 18 for(int i = 0; i < N; i++) {
            A[i] = scan.nextLong();
            if(A[i] == 0) {
                os.println(0);
                return;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            A[i] = scan.nextLong();
            if(A[i] == 0) {
                os.println(0);
                return;
            }
        } {
            A[i] = scan.nextLong();
            if(A[i] == 0) {
                os.println(0);
                return;
            }
        } A[i] = scan.nextLong() A[i] A i scan.nextLong() scan.nextLong scan if(A[i] == 0) {
                os.println(0);
                return;
            } A[i] == 0 A[i] A i 0 {
                os.println(0);
                return;
            } os.println(0) os.println os 0 return; for(int i = 0; i < N; i++) {
            if(ans > max/A[i]) {
                os.println(-1);
                return;
            }
            ans *= A[i];
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if(ans > max/A[i]) {
                os.println(-1);
                return;
            }
            ans *= A[i];
        } {
            if(ans > max/A[i]) {
                os.println(-1);
                return;
            }
            ans *= A[i];
        } if(ans > max/A[i]) {
                os.println(-1);
                return;
            } ans > max/A[i] ans max/A[i] max A[i] A i {
                os.println(-1);
                return;
            } os.println(-1) os.println os -1 1 return; ans *= A[i] ans A[i] A i os.println(ans) os.println os ans InputStream is is PrintStream os os public class Main {
    public static void main(String[] args) throws Exception {
        solve(System.in, System.out);
    }

    static void solve(InputStream is, PrintStream os) {
        // Your code here!
        Scanner scan = new Scanner(is);
        int N = scan.nextInt();
        long ans = 1;
        long A[] = new long[N];
        long max = (long)Math.pow(10, 18);

        for(int i = 0; i < N; i++) {
            A[i] = scan.nextLong();
            if(A[i] == 0) {
                os.println(0);
                return;
            }
        }

        for(int i = 0; i < N; i++) {
            if(ans > max/A[i]) {
                os.println(-1);
                return;
            }
            ans *= A[i];
        }
        os.println(ans);

    }
} public class Main {
    public static void main(String[] args) throws Exception {
        solve(System.in, System.out);
    }

    static void solve(InputStream is, PrintStream os) {
        // Your code here!
        Scanner scan = new Scanner(is);
        int N = scan.nextInt();
        long ans = 1;
        long A[] = new long[N];
        long max = (long)Math.pow(10, 18);

        for(int i = 0; i < N; i++) {
            A[i] = scan.nextLong();
            if(A[i] == 0) {
                os.println(0);
                return;
            }
        }

        for(int i = 0; i < N; i++) {
            if(ans > max/A[i]) {
                os.println(-1);
                return;
            }
            ans *= A[i];
        }
        os.println(ans);

    }
} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        solve(System.in, System.out);
    }

    static void solve(InputStream is, PrintStream os) {
        // Your code here!
        Scanner scan = new Scanner(is);
        int N = scan.nextInt();
        long ans = 1;
        long A[] = new long[N];
        long max = (long)Math.pow(10, 18);

        for(int i = 0; i < N; i++) {
            A[i] = scan.nextLong();
            if(A[i] == 0) {
                os.println(0);
                return;
            }
        }

        for(int i = 0; i < N; i++) {
            if(ans > max/A[i]) {
                os.println(-1);
                return;
            }
            ans *= A[i];
        }
        os.println(ans);

    }
}