import java.util.Scanner;

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

        long res = 1;
        long sup = pow10(18);
        long num;
        for(int i = 0; i < n; i++){
            num = sc.nextLong();
            if(res == 0){
            } else if(num == 0){
                res = 0;
            } else if(res == -1){
            } else if(sup / res >= num){
                res = res * num;
            } else{
                res = -1;
            }
        }
        System.out.println(res);
        sc.close();
    }
    static long pow10(int n){
        long c = 1;
        for(int i = 0; i < n; i++){
            c *= 10;
        }
        return c;
    }
} 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 res = 1;
        long sup = pow10(18);
        long num;
        for(int i = 0; i < n; i++){
            num = sc.nextLong();
            if(res == 0){
            } else if(num == 0){
                res = 0;
            } else if(res == -1){
            } else if(sup / res >= num){
                res = res * num;
            } else{
                res = -1;
            }
        }
        System.out.println(res);
        sc.close();
    }
    static long pow10(int n){
        long c = 1;
        for(int i = 0; i < n; i++){
            c *= 10;
        }
        return c;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        long res = 1;
        long sup = pow10(18);
        long num;
        for(int i = 0; i < n; i++){
            num = sc.nextLong();
            if(res == 0){
            } else if(num == 0){
                res = 0;
            } else if(res == -1){
            } else if(sup / res >= num){
                res = res * num;
            } else{
                res = -1;
            }
        }
        System.out.println(res);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        long res = 1;
        long sup = pow10(18);
        long num;
        for(int i = 0; i < n; i++){
            num = sc.nextLong();
            if(res == 0){
            } else if(num == 0){
                res = 0;
            } else if(res == -1){
            } else if(sup / res >= num){
                res = res * num;
            } else{
                res = -1;
            }
        }
        System.out.println(res);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long res = 1; res 1 long sup = pow10(18); sup pow10(18) pow10 18 long num; num for(int i = 0; i < n; i++){
            num = sc.nextLong();
            if(res == 0){
            } else if(num == 0){
                res = 0;
            } else if(res == -1){
            } else if(sup / res >= num){
                res = res * num;
            } else{
                res = -1;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            num = sc.nextLong();
            if(res == 0){
            } else if(num == 0){
                res = 0;
            } else if(res == -1){
            } else if(sup / res >= num){
                res = res * num;
            } else{
                res = -1;
            }
        } {
            num = sc.nextLong();
            if(res == 0){
            } else if(num == 0){
                res = 0;
            } else if(res == -1){
            } else if(sup / res >= num){
                res = res * num;
            } else{
                res = -1;
            }
        } num = sc.nextLong() num sc.nextLong() sc.nextLong sc if(res == 0){
            } else if(num == 0){
                res = 0;
            } else if(res == -1){
            } else if(sup / res >= num){
                res = res * num;
            } else{
                res = -1;
            } res == 0 res 0 {
            } if(num == 0){
                res = 0;
            } else if(res == -1){
            } else if(sup / res >= num){
                res = res * num;
            } else{
                res = -1;
            } num == 0 num 0 {
                res = 0;
            } res = 0 res 0 if(res == -1){
            } else if(sup / res >= num){
                res = res * num;
            } else{
                res = -1;
            } res == -1 res -1 1 {
            } if(sup / res >= num){
                res = res * num;
            } else{
                res = -1;
            } sup / res >= num sup / res sup res num {
                res = res * num;
            } res = res * num res res * num res num {
                res = -1;
            } res = -1 res -1 1 System.out.println(res) System.out.println System.out System System.out res sc.close() sc.close sc String[] args args static long pow10(int n){
        long c = 1;
        for(int i = 0; i < n; i++){
            c *= 10;
        }
        return c;
    } pow10 {
        long c = 1;
        for(int i = 0; i < n; i++){
            c *= 10;
        }
        return c;
    } long c = 1; c 1 for(int i = 0; i < n; i++){
            c *= 10;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            c *= 10;
        } {
            c *= 10;
        } c *= 10 c 10 return c; c int n n public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        long res = 1;
        long sup = pow10(18);
        long num;
        for(int i = 0; i < n; i++){
            num = sc.nextLong();
            if(res == 0){
            } else if(num == 0){
                res = 0;
            } else if(res == -1){
            } else if(sup / res >= num){
                res = res * num;
            } else{
                res = -1;
            }
        }
        System.out.println(res);
        sc.close();
    }
    static long pow10(int n){
        long c = 1;
        for(int i = 0; i < n; i++){
            c *= 10;
        }
        return c;
    }
} public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        long res = 1;
        long sup = pow10(18);
        long num;
        for(int i = 0; i < n; i++){
            num = sc.nextLong();
            if(res == 0){
            } else if(num == 0){
                res = 0;
            } else if(res == -1){
            } else if(sup / res >= num){
                res = res * num;
            } else{
                res = -1;
            }
        }
        System.out.println(res);
        sc.close();
    }
    static long pow10(int n){
        long c = 1;
        for(int i = 0; i < n; i++){
            c *= 10;
        }
        return c;
    }
} Main
import java.util.Scanner;

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

        long res = 1;
        long sup = pow10(18);
        long num;
        for(int i = 0; i < n; i++){
            num = sc.nextLong();
            if(res == 0){
            } else if(num == 0){
                res = 0;
            } else if(res == -1){
            } else if(sup / res >= num){
                res = res * num;
            } else{
                res = -1;
            }
        }
        System.out.println(res);
        sc.close();
    }
    static long pow10(int n){
        long c = 1;
        for(int i = 0; i < n; i++){
            c *= 10;
        }
        return c;
    }
}