import java.util.Scanner;
import java.util.Collections;
import java.util.Arrays;
import java.math.BigInteger;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        BigInteger[] a = new BigInteger[n];
        for(int i=0; i<n; i++) {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.valueOf(0))) {
                System.out.println(0);
                System.exit(0);
            }
        }
        sc.close();
        java.util.Arrays.sort(a, Collections.reverseOrder());

        BigInteger ans = BigInteger.valueOf(1);
                   //1000000000000000000
        BigInteger limit = BigInteger.valueOf(1000000000000000000L);
        for(int i=0; i<n; i++) {
            ans = ans.multiply(a[i]);
            if(ans.compareTo(limit) > 0) {
                System.out.println(-1);
                System.exit(0);
            }
        }
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util import java.util.Collections; Collections java.util import java.util.Arrays; Arrays java.util import java.math.BigInteger; BigInteger java.math public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        BigInteger[] a = new BigInteger[n];
        for(int i=0; i<n; i++) {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.valueOf(0))) {
                System.out.println(0);
                System.exit(0);
            }
        }
        sc.close();
        java.util.Arrays.sort(a, Collections.reverseOrder());

        BigInteger ans = BigInteger.valueOf(1);
                   //1000000000000000000
        BigInteger limit = BigInteger.valueOf(1000000000000000000L);
        for(int i=0; i<n; i++) {
            ans = ans.multiply(a[i]);
            if(ans.compareTo(limit) > 0) {
                System.out.println(-1);
                System.exit(0);
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        BigInteger[] a = new BigInteger[n];
        for(int i=0; i<n; i++) {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.valueOf(0))) {
                System.out.println(0);
                System.exit(0);
            }
        }
        sc.close();
        java.util.Arrays.sort(a, Collections.reverseOrder());

        BigInteger ans = BigInteger.valueOf(1);
                   //1000000000000000000
        BigInteger limit = BigInteger.valueOf(1000000000000000000L);
        for(int i=0; i<n; i++) {
            ans = ans.multiply(a[i]);
            if(ans.compareTo(limit) > 0) {
                System.out.println(-1);
                System.exit(0);
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        BigInteger[] a = new BigInteger[n];
        for(int i=0; i<n; i++) {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.valueOf(0))) {
                System.out.println(0);
                System.exit(0);
            }
        }
        sc.close();
        java.util.Arrays.sort(a, Collections.reverseOrder());

        BigInteger ans = BigInteger.valueOf(1);
                   //1000000000000000000
        BigInteger limit = BigInteger.valueOf(1000000000000000000L);
        for(int i=0; i<n; i++) {
            ans = ans.multiply(a[i]);
            if(ans.compareTo(limit) > 0) {
                System.out.println(-1);
                System.exit(0);
            }
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc BigInteger[] a = new BigInteger[n]; a new BigInteger[n] n for(int i=0; i<n; i++) {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.valueOf(0))) {
                System.out.println(0);
                System.exit(0);
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.valueOf(0))) {
                System.out.println(0);
                System.exit(0);
            }
        } {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.valueOf(0))) {
                System.out.println(0);
                System.exit(0);
            }
        } a[i] = sc.nextBigInteger() a[i] a i sc.nextBigInteger() sc.nextBigInteger sc if(a[i].equals(BigInteger.valueOf(0))) {
                System.out.println(0);
                System.exit(0);
            } a[i].equals(BigInteger.valueOf(0)) a[i].equals a[i] a i BigInteger.valueOf(0) BigInteger.valueOf BigInteger 0 {
                System.out.println(0);
                System.exit(0);
            } System.out.println(0) System.out.println System.out System System.out 0 System.exit(0) System.exit System 0 sc.close() sc.close sc java.util.Arrays.sort(a, Collections.reverseOrder()) java.util.Arrays.sort java.util.Arrays java.util java java.util java.util.Arrays a Collections.reverseOrder() Collections.reverseOrder Collections BigInteger ans = BigInteger.valueOf(1); ans BigInteger.valueOf(1) BigInteger.valueOf BigInteger 1 BigInteger limit = BigInteger.valueOf(1000000000000000000L); limit BigInteger.valueOf(1000000000000000000L) BigInteger.valueOf BigInteger 1000000000000000000L for(int i=0; i<n; i++) {
            ans = ans.multiply(a[i]);
            if(ans.compareTo(limit) > 0) {
                System.out.println(-1);
                System.exit(0);
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            ans = ans.multiply(a[i]);
            if(ans.compareTo(limit) > 0) {
                System.out.println(-1);
                System.exit(0);
            }
        } {
            ans = ans.multiply(a[i]);
            if(ans.compareTo(limit) > 0) {
                System.out.println(-1);
                System.exit(0);
            }
        } ans = ans.multiply(a[i]) ans ans.multiply(a[i]) ans.multiply ans a[i] a i if(ans.compareTo(limit) > 0) {
                System.out.println(-1);
                System.exit(0);
            } ans.compareTo(limit) > 0 ans.compareTo(limit) ans.compareTo ans limit 0 {
                System.out.println(-1);
                System.exit(0);
            } System.out.println(-1) System.out.println System.out System System.out -1 1 System.exit(0) System.exit System 0 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        BigInteger[] a = new BigInteger[n];
        for(int i=0; i<n; i++) {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.valueOf(0))) {
                System.out.println(0);
                System.exit(0);
            }
        }
        sc.close();
        java.util.Arrays.sort(a, Collections.reverseOrder());

        BigInteger ans = BigInteger.valueOf(1);
                   //1000000000000000000
        BigInteger limit = BigInteger.valueOf(1000000000000000000L);
        for(int i=0; i<n; i++) {
            ans = ans.multiply(a[i]);
            if(ans.compareTo(limit) > 0) {
                System.out.println(-1);
                System.exit(0);
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        BigInteger[] a = new BigInteger[n];
        for(int i=0; i<n; i++) {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.valueOf(0))) {
                System.out.println(0);
                System.exit(0);
            }
        }
        sc.close();
        java.util.Arrays.sort(a, Collections.reverseOrder());

        BigInteger ans = BigInteger.valueOf(1);
                   //1000000000000000000
        BigInteger limit = BigInteger.valueOf(1000000000000000000L);
        for(int i=0; i<n; i++) {
            ans = ans.multiply(a[i]);
            if(ans.compareTo(limit) > 0) {
                System.out.println(-1);
                System.exit(0);
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.Scanner;
import java.util.Collections;
import java.util.Arrays;
import java.math.BigInteger;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        BigInteger[] a = new BigInteger[n];
        for(int i=0; i<n; i++) {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.valueOf(0))) {
                System.out.println(0);
                System.exit(0);
            }
        }
        sc.close();
        java.util.Arrays.sort(a, Collections.reverseOrder());

        BigInteger ans = BigInteger.valueOf(1);
                   //1000000000000000000
        BigInteger limit = BigInteger.valueOf(1000000000000000000L);
        for(int i=0; i<n; i++) {
            ans = ans.multiply(a[i]);
            if(ans.compareTo(limit) > 0) {
                System.out.println(-1);
                System.exit(0);
            }
        }
        System.out.println(ans);
    }
}
