import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        long result = 1;
        long max = 1000000000000000000L;
        for (int i = 0 ; i < N ; i++) {
            long a = scanner.nextLong();
            if (a == 0) {
                result = 0;
                break;
            }
            if (result != -1 && max / result >= a) {
                result *= a;
            } else {
                result = -1;
            }
        }
        
        System.out.println(result);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        long result = 1;
        long max = 1000000000000000000L;
        for (int i = 0 ; i < N ; i++) {
            long a = scanner.nextLong();
            if (a == 0) {
                result = 0;
                break;
            }
            if (result != -1 && max / result >= a) {
                result *= a;
            } else {
                result = -1;
            }
        }
        
        System.out.println(result);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        long result = 1;
        long max = 1000000000000000000L;
        for (int i = 0 ; i < N ; i++) {
            long a = scanner.nextLong();
            if (a == 0) {
                result = 0;
                break;
            }
            if (result != -1 && max / result >= a) {
                result *= a;
            } else {
                result = -1;
            }
        }
        
        System.out.println(result);
    } main {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        long result = 1;
        long max = 1000000000000000000L;
        for (int i = 0 ; i < N ; i++) {
            long a = scanner.nextLong();
            if (a == 0) {
                result = 0;
                break;
            }
            if (result != -1 && max / result >= a) {
                result *= a;
            } else {
                result = -1;
            }
        }
        
        System.out.println(result);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner long result = 1; result 1 long max = 1000000000000000000L; max 1000000000000000000L for (int i = 0 ; i < N ; i++) {
            long a = scanner.nextLong();
            if (a == 0) {
                result = 0;
                break;
            }
            if (result != -1 && max / result >= a) {
                result *= a;
            } else {
                result = -1;
            }
        } int i = 0 ; int i = 0 ; i 0 i < N i N i++ i++ i {
            long a = scanner.nextLong();
            if (a == 0) {
                result = 0;
                break;
            }
            if (result != -1 && max / result >= a) {
                result *= a;
            } else {
                result = -1;
            }
        } {
            long a = scanner.nextLong();
            if (a == 0) {
                result = 0;
                break;
            }
            if (result != -1 && max / result >= a) {
                result *= a;
            } else {
                result = -1;
            }
        } long a = scanner.nextLong(); a scanner.nextLong() scanner.nextLong scanner if (a == 0) {
                result = 0;
                break;
            } a == 0 a 0 {
                result = 0;
                break;
            } result = 0 result 0 break; if (result != -1 && max / result >= a) {
                result *= a;
            } else {
                result = -1;
            } result != -1 && max / result >= a result != -1 result -1 1 max / result >= a max / result max result a {
                result *= a;
            } result *= a result a {
                result = -1;
            } result = -1 result -1 1 System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        long result = 1;
        long max = 1000000000000000000L;
        for (int i = 0 ; i < N ; i++) {
            long a = scanner.nextLong();
            if (a == 0) {
                result = 0;
                break;
            }
            if (result != -1 && max / result >= a) {
                result *= a;
            } else {
                result = -1;
            }
        }
        
        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        long result = 1;
        long max = 1000000000000000000L;
        for (int i = 0 ; i < N ; i++) {
            long a = scanner.nextLong();
            if (a == 0) {
                result = 0;
                break;
            }
            if (result != -1 && max / result >= a) {
                result *= a;
            } else {
                result = -1;
            }
        }
        
        System.out.println(result);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        long result = 1;
        long max = 1000000000000000000L;
        for (int i = 0 ; i < N ; i++) {
            long a = scanner.nextLong();
            if (a == 0) {
                result = 0;
                break;
            }
            if (result != -1 && max / result >= a) {
                result *= a;
            } else {
                result = -1;
            }
        }
        
        System.out.println(result);
    }
}
