
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 = 1000000000000000000l;

        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++) {
            long digits = digits(A[i]);
            digits += digits(ans);

            if(digits > 18) {
                os.println(-1);
                return;
            }
            if(digits == 18) {
                int AFirst = fitstDigit(A[i]);
                int ansFirst = fitstDigit(ans);
                if(ansFirst != 1 || AFirst != 1){
                    os.println(-1);
                    return;
                }
            }
            ans *= A[i];
            if(ans > max) {
                os.println(-1);
                return;
            }
        }
        os.println(ans);

    }

    static int digits(long value) {
        int digits = 0;
        while(value/10 > 1){
            value /= 10;
            digits++;
        }
        return digits;
    }

    static int fitstDigit(long value) {
        while(value/10 > 1){
            value /= 10;
        }
        return (int)value;
    }
} 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 = 1000000000000000000l;

        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++) {
            long digits = digits(A[i]);
            digits += digits(ans);

            if(digits > 18) {
                os.println(-1);
                return;
            }
            if(digits == 18) {
                int AFirst = fitstDigit(A[i]);
                int ansFirst = fitstDigit(ans);
                if(ansFirst != 1 || AFirst != 1){
                    os.println(-1);
                    return;
                }
            }
            ans *= A[i];
            if(ans > max) {
                os.println(-1);
                return;
            }
        }
        os.println(ans);

    }

    static int digits(long value) {
        int digits = 0;
        while(value/10 > 1){
            value /= 10;
            digits++;
        }
        return digits;
    }

    static int fitstDigit(long value) {
        while(value/10 > 1){
            value /= 10;
        }
        return (int)value;
    }
} 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 = 1000000000000000000l;

        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++) {
            long digits = digits(A[i]);
            digits += digits(ans);

            if(digits > 18) {
                os.println(-1);
                return;
            }
            if(digits == 18) {
                int AFirst = fitstDigit(A[i]);
                int ansFirst = fitstDigit(ans);
                if(ansFirst != 1 || AFirst != 1){
                    os.println(-1);
                    return;
                }
            }
            ans *= A[i];
            if(ans > max) {
                os.println(-1);
                return;
            }
        }
        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 = 1000000000000000000l;

        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++) {
            long digits = digits(A[i]);
            digits += digits(ans);

            if(digits > 18) {
                os.println(-1);
                return;
            }
            if(digits == 18) {
                int AFirst = fitstDigit(A[i]);
                int ansFirst = fitstDigit(ans);
                if(ansFirst != 1 || AFirst != 1){
                    os.println(-1);
                    return;
                }
            }
            ans *= A[i];
            if(ans > max) {
                os.println(-1);
                return;
            }
        }
        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 = 1000000000000000000l; max 1000000000000000000l 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++) {
            long digits = digits(A[i]);
            digits += digits(ans);

            if(digits > 18) {
                os.println(-1);
                return;
            }
            if(digits == 18) {
                int AFirst = fitstDigit(A[i]);
                int ansFirst = fitstDigit(ans);
                if(ansFirst != 1 || AFirst != 1){
                    os.println(-1);
                    return;
                }
            }
            ans *= A[i];
            if(ans > max) {
                os.println(-1);
                return;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            long digits = digits(A[i]);
            digits += digits(ans);

            if(digits > 18) {
                os.println(-1);
                return;
            }
            if(digits == 18) {
                int AFirst = fitstDigit(A[i]);
                int ansFirst = fitstDigit(ans);
                if(ansFirst != 1 || AFirst != 1){
                    os.println(-1);
                    return;
                }
            }
            ans *= A[i];
            if(ans > max) {
                os.println(-1);
                return;
            }
        } {
            long digits = digits(A[i]);
            digits += digits(ans);

            if(digits > 18) {
                os.println(-1);
                return;
            }
            if(digits == 18) {
                int AFirst = fitstDigit(A[i]);
                int ansFirst = fitstDigit(ans);
                if(ansFirst != 1 || AFirst != 1){
                    os.println(-1);
                    return;
                }
            }
            ans *= A[i];
            if(ans > max) {
                os.println(-1);
                return;
            }
        } long digits = digits(A[i]); digits digits(A[i]) digits A[i] A i digits += digits(ans) digits digits(ans) digits ans if(digits > 18) {
                os.println(-1);
                return;
            } digits > 18 digits 18 {
                os.println(-1);
                return;
            } os.println(-1) os.println os -1 1 return; if(digits == 18) {
                int AFirst = fitstDigit(A[i]);
                int ansFirst = fitstDigit(ans);
                if(ansFirst != 1 || AFirst != 1){
                    os.println(-1);
                    return;
                }
            } digits == 18 digits 18 {
                int AFirst = fitstDigit(A[i]);
                int ansFirst = fitstDigit(ans);
                if(ansFirst != 1 || AFirst != 1){
                    os.println(-1);
                    return;
                }
            } int AFirst = fitstDigit(A[i]); AFirst fitstDigit(A[i]) fitstDigit A[i] A i int ansFirst = fitstDigit(ans); ansFirst fitstDigit(ans) fitstDigit ans if(ansFirst != 1 || AFirst != 1){
                    os.println(-1);
                    return;
                } ansFirst != 1 || AFirst != 1 ansFirst != 1 ansFirst 1 AFirst != 1 AFirst 1 {
                    os.println(-1);
                    return;
                } os.println(-1) os.println os -1 1 return; ans *= A[i] ans A[i] A i if(ans > max) {
                os.println(-1);
                return;
            } ans > max ans max {
                os.println(-1);
                return;
            } os.println(-1) os.println os -1 1 return; os.println(ans) os.println os ans InputStream is is PrintStream os os static int digits(long value) {
        int digits = 0;
        while(value/10 > 1){
            value /= 10;
            digits++;
        }
        return digits;
    } digits {
        int digits = 0;
        while(value/10 > 1){
            value /= 10;
            digits++;
        }
        return digits;
    } int digits = 0; digits 0 while(value/10 > 1){
            value /= 10;
            digits++;
        } value/10 > 1 value/10 value 10 1 {
            value /= 10;
            digits++;
        } value /= 10 value 10 digits++ digits return digits; digits long value value static int fitstDigit(long value) {
        while(value/10 > 1){
            value /= 10;
        }
        return (int)value;
    } fitstDigit {
        while(value/10 > 1){
            value /= 10;
        }
        return (int)value;
    } while(value/10 > 1){
            value /= 10;
        } value/10 > 1 value/10 value 10 1 {
            value /= 10;
        } value /= 10 value 10 return (int)value; (int)value long value value 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 = 1000000000000000000l;

        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++) {
            long digits = digits(A[i]);
            digits += digits(ans);

            if(digits > 18) {
                os.println(-1);
                return;
            }
            if(digits == 18) {
                int AFirst = fitstDigit(A[i]);
                int ansFirst = fitstDigit(ans);
                if(ansFirst != 1 || AFirst != 1){
                    os.println(-1);
                    return;
                }
            }
            ans *= A[i];
            if(ans > max) {
                os.println(-1);
                return;
            }
        }
        os.println(ans);

    }

    static int digits(long value) {
        int digits = 0;
        while(value/10 > 1){
            value /= 10;
            digits++;
        }
        return digits;
    }

    static int fitstDigit(long value) {
        while(value/10 > 1){
            value /= 10;
        }
        return (int)value;
    }
} 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 = 1000000000000000000l;

        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++) {
            long digits = digits(A[i]);
            digits += digits(ans);

            if(digits > 18) {
                os.println(-1);
                return;
            }
            if(digits == 18) {
                int AFirst = fitstDigit(A[i]);
                int ansFirst = fitstDigit(ans);
                if(ansFirst != 1 || AFirst != 1){
                    os.println(-1);
                    return;
                }
            }
            ans *= A[i];
            if(ans > max) {
                os.println(-1);
                return;
            }
        }
        os.println(ans);

    }

    static int digits(long value) {
        int digits = 0;
        while(value/10 > 1){
            value /= 10;
            digits++;
        }
        return digits;
    }

    static int fitstDigit(long value) {
        while(value/10 > 1){
            value /= 10;
        }
        return (int)value;
    }
} 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 = 1000000000000000000l;

        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++) {
            long digits = digits(A[i]);
            digits += digits(ans);

            if(digits > 18) {
                os.println(-1);
                return;
            }
            if(digits == 18) {
                int AFirst = fitstDigit(A[i]);
                int ansFirst = fitstDigit(ans);
                if(ansFirst != 1 || AFirst != 1){
                    os.println(-1);
                    return;
                }
            }
            ans *= A[i];
            if(ans > max) {
                os.println(-1);
                return;
            }
        }
        os.println(ans);

    }

    static int digits(long value) {
        int digits = 0;
        while(value/10 > 1){
            value /= 10;
            digits++;
        }
        return digits;
    }

    static int fitstDigit(long value) {
        while(value/10 > 1){
            value /= 10;
        }
        return (int)value;
    }
}