import java.util.Scanner;

/**
 * B - Multiplication 2
 * N 個の整数 A1,...,AN が与えられます。
 * A1×...×AN を求めてください。
 * ただし、結果が 10の18乗 を超える場合は、代わりに -1 を出力してください。
 */
public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner( System.in );
        // 入力値
        int n = sc.nextInt();
        long[] a = new long[n];

        for ( int i = 0; i < n; i++ ) {
            a[i] = sc.nextLong();
            if ( a[i] == 0 ) {
                System.out.println(0);
                sc.close();
                return;
            }
        }

        // 最大値
        long max = ( long ) Math.pow( 10, 18 );

        // 入力値を計算
        long result = 1;
        for( int i = 0; i < n; i++ ) {

            try {
                result = Math.multiplyExact( result, a[i] );
                if( result > max ) {
                    System.out.println( "-1" );
                    sc.close();
                    return;
                }
            }
            catch ( Exception e ) {
                System.out.println( "-1" );
                sc.close();
                return;
            }
        }

        System.out.println( result );

        sc.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner( System.in );
        // 入力値
        int n = sc.nextInt();
        long[] a = new long[n];

        for ( int i = 0; i < n; i++ ) {
            a[i] = sc.nextLong();
            if ( a[i] == 0 ) {
                System.out.println(0);
                sc.close();
                return;
            }
        }

        // 最大値
        long max = ( long ) Math.pow( 10, 18 );

        // 入力値を計算
        long result = 1;
        for( int i = 0; i < n; i++ ) {

            try {
                result = Math.multiplyExact( result, a[i] );
                if( result > max ) {
                    System.out.println( "-1" );
                    sc.close();
                    return;
                }
            }
            catch ( Exception e ) {
                System.out.println( "-1" );
                sc.close();
                return;
            }
        }

        System.out.println( result );

        sc.close();
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner( System.in );
        // 入力値
        int n = sc.nextInt();
        long[] a = new long[n];

        for ( int i = 0; i < n; i++ ) {
            a[i] = sc.nextLong();
            if ( a[i] == 0 ) {
                System.out.println(0);
                sc.close();
                return;
            }
        }

        // 最大値
        long max = ( long ) Math.pow( 10, 18 );

        // 入力値を計算
        long result = 1;
        for( int i = 0; i < n; i++ ) {

            try {
                result = Math.multiplyExact( result, a[i] );
                if( result > max ) {
                    System.out.println( "-1" );
                    sc.close();
                    return;
                }
            }
            catch ( Exception e ) {
                System.out.println( "-1" );
                sc.close();
                return;
            }
        }

        System.out.println( result );

        sc.close();
    } main {

        Scanner sc = new Scanner( System.in );
        // 入力値
        int n = sc.nextInt();
        long[] a = new long[n];

        for ( int i = 0; i < n; i++ ) {
            a[i] = sc.nextLong();
            if ( a[i] == 0 ) {
                System.out.println(0);
                sc.close();
                return;
            }
        }

        // 最大値
        long max = ( long ) Math.pow( 10, 18 );

        // 入力値を計算
        long result = 1;
        for( int i = 0; i < n; i++ ) {

            try {
                result = Math.multiplyExact( result, a[i] );
                if( result > max ) {
                    System.out.println( "-1" );
                    sc.close();
                    return;
                }
            }
            catch ( Exception e ) {
                System.out.println( "-1" );
                sc.close();
                return;
            }
        }

        System.out.println( result );

        sc.close();
    } Scanner sc = new Scanner( System.in ); sc new Scanner( System.in ) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long[] a = new long[n]; a new long[n] n for ( int i = 0; i < n; i++ ) {
            a[i] = sc.nextLong();
            if ( a[i] == 0 ) {
                System.out.println(0);
                sc.close();
                return;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a[i] = sc.nextLong();
            if ( a[i] == 0 ) {
                System.out.println(0);
                sc.close();
                return;
            }
        } {
            a[i] = sc.nextLong();
            if ( a[i] == 0 ) {
                System.out.println(0);
                sc.close();
                return;
            }
        } a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc if ( a[i] == 0 ) {
                System.out.println(0);
                sc.close();
                return;
            } a[i] == 0 a[i] a i 0 {
                System.out.println(0);
                sc.close();
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 sc.close() sc.close sc return; long max = ( long ) Math.pow( 10, 18 ); max ( long ) Math.pow( 10, 18 ) Math.pow Math 10 18 long result = 1; result 1 for( int i = 0; i < n; i++ ) {

            try {
                result = Math.multiplyExact( result, a[i] );
                if( result > max ) {
                    System.out.println( "-1" );
                    sc.close();
                    return;
                }
            }
            catch ( Exception e ) {
                System.out.println( "-1" );
                sc.close();
                return;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

            try {
                result = Math.multiplyExact( result, a[i] );
                if( result > max ) {
                    System.out.println( "-1" );
                    sc.close();
                    return;
                }
            }
            catch ( Exception e ) {
                System.out.println( "-1" );
                sc.close();
                return;
            }
        } {

            try {
                result = Math.multiplyExact( result, a[i] );
                if( result > max ) {
                    System.out.println( "-1" );
                    sc.close();
                    return;
                }
            }
            catch ( Exception e ) {
                System.out.println( "-1" );
                sc.close();
                return;
            }
        } try {
                result = Math.multiplyExact( result, a[i] );
                if( result > max ) {
                    System.out.println( "-1" );
                    sc.close();
                    return;
                }
            }
            catch ( Exception e ) {
                System.out.println( "-1" );
                sc.close();
                return;
            } catch ( Exception e ) {
                System.out.println( "-1" );
                sc.close();
                return;
            } Exception e {
                System.out.println( "-1" );
                sc.close();
                return;
            } System.out.println( "-1" ) System.out.println System.out System System.out "-1" sc.close() sc.close sc return; {
                result = Math.multiplyExact( result, a[i] );
                if( result > max ) {
                    System.out.println( "-1" );
                    sc.close();
                    return;
                }
            } result = Math.multiplyExact( result, a[i] ) result Math.multiplyExact( result, a[i] ) Math.multiplyExact Math result a[i] a i if( result > max ) {
                    System.out.println( "-1" );
                    sc.close();
                    return;
                } result > max result max {
                    System.out.println( "-1" );
                    sc.close();
                    return;
                } System.out.println( "-1" ) System.out.println System.out System System.out "-1" sc.close() sc.close sc return; System.out.println( result ) System.out.println System.out System System.out result sc.close() sc.close sc String[] args args public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner( System.in );
        // 入力値
        int n = sc.nextInt();
        long[] a = new long[n];

        for ( int i = 0; i < n; i++ ) {
            a[i] = sc.nextLong();
            if ( a[i] == 0 ) {
                System.out.println(0);
                sc.close();
                return;
            }
        }

        // 最大値
        long max = ( long ) Math.pow( 10, 18 );

        // 入力値を計算
        long result = 1;
        for( int i = 0; i < n; i++ ) {

            try {
                result = Math.multiplyExact( result, a[i] );
                if( result > max ) {
                    System.out.println( "-1" );
                    sc.close();
                    return;
                }
            }
            catch ( Exception e ) {
                System.out.println( "-1" );
                sc.close();
                return;
            }
        }

        System.out.println( result );

        sc.close();
    }
} public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner( System.in );
        // 入力値
        int n = sc.nextInt();
        long[] a = new long[n];

        for ( int i = 0; i < n; i++ ) {
            a[i] = sc.nextLong();
            if ( a[i] == 0 ) {
                System.out.println(0);
                sc.close();
                return;
            }
        }

        // 最大値
        long max = ( long ) Math.pow( 10, 18 );

        // 入力値を計算
        long result = 1;
        for( int i = 0; i < n; i++ ) {

            try {
                result = Math.multiplyExact( result, a[i] );
                if( result > max ) {
                    System.out.println( "-1" );
                    sc.close();
                    return;
                }
            }
            catch ( Exception e ) {
                System.out.println( "-1" );
                sc.close();
                return;
            }
        }

        System.out.println( result );

        sc.close();
    }
} Main
import java.util.Scanner;

/**
 * B - Multiplication 2
 * N 個の整数 A1,...,AN が与えられます。
 * A1×...×AN を求めてください。
 * ただし、結果が 10の18乗 を超える場合は、代わりに -1 を出力してください。
 */
public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner( System.in );
        // 入力値
        int n = sc.nextInt();
        long[] a = new long[n];

        for ( int i = 0; i < n; i++ ) {
            a[i] = sc.nextLong();
            if ( a[i] == 0 ) {
                System.out.println(0);
                sc.close();
                return;
            }
        }

        // 最大値
        long max = ( long ) Math.pow( 10, 18 );

        // 入力値を計算
        long result = 1;
        for( int i = 0; i < n; i++ ) {

            try {
                result = Math.multiplyExact( result, a[i] );
                if( result > max ) {
                    System.out.println( "-1" );
                    sc.close();
                    return;
                }
            }
            catch ( Exception e ) {
                System.out.println( "-1" );
                sc.close();
                return;
            }
        }

        System.out.println( result );

        sc.close();
    }
}