import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        long sum = 1;
        for(int i=0; i<N; i++) {
            long next = Long.parseLong(sc.next());
            if(next == 0) {
                sum = 0;
                break;
            }
            if(sum != -1) {
                if(1000000000000000000L / next < sum) {
                    sum = -1;
                }else {
                    sum *= next;
                }
            }else {
                continue;
            }
        }
        System.out.println(sum);
        
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        long sum = 1;
        for(int i=0; i<N; i++) {
            long next = Long.parseLong(sc.next());
            if(next == 0) {
                sum = 0;
                break;
            }
            if(sum != -1) {
                if(1000000000000000000L / next < sum) {
                    sum = -1;
                }else {
                    sum *= next;
                }
            }else {
                continue;
            }
        }
        System.out.println(sum);
        
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        long sum = 1;
        for(int i=0; i<N; i++) {
            long next = Long.parseLong(sc.next());
            if(next == 0) {
                sum = 0;
                break;
            }
            if(sum != -1) {
                if(1000000000000000000L / next < sum) {
                    sum = -1;
                }else {
                    sum *= next;
                }
            }else {
                continue;
            }
        }
        System.out.println(sum);
        
    } main {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        long sum = 1;
        for(int i=0; i<N; i++) {
            long next = Long.parseLong(sc.next());
            if(next == 0) {
                sum = 0;
                break;
            }
            if(sum != -1) {
                if(1000000000000000000L / next < sum) {
                    sum = -1;
                }else {
                    sum *= next;
                }
            }else {
                continue;
            }
        }
        System.out.println(sum);
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc long sum = 1; sum 1 for(int i=0; i<N; i++) {
            long next = Long.parseLong(sc.next());
            if(next == 0) {
                sum = 0;
                break;
            }
            if(sum != -1) {
                if(1000000000000000000L / next < sum) {
                    sum = -1;
                }else {
                    sum *= next;
                }
            }else {
                continue;
            }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            long next = Long.parseLong(sc.next());
            if(next == 0) {
                sum = 0;
                break;
            }
            if(sum != -1) {
                if(1000000000000000000L / next < sum) {
                    sum = -1;
                }else {
                    sum *= next;
                }
            }else {
                continue;
            }
        } {
            long next = Long.parseLong(sc.next());
            if(next == 0) {
                sum = 0;
                break;
            }
            if(sum != -1) {
                if(1000000000000000000L / next < sum) {
                    sum = -1;
                }else {
                    sum *= next;
                }
            }else {
                continue;
            }
        } long next = Long.parseLong(sc.next()); next Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc if(next == 0) {
                sum = 0;
                break;
            } next == 0 next 0 {
                sum = 0;
                break;
            } sum = 0 sum 0 break; if(sum != -1) {
                if(1000000000000000000L / next < sum) {
                    sum = -1;
                }else {
                    sum *= next;
                }
            }else {
                continue;
            } sum != -1 sum -1 1 {
                if(1000000000000000000L / next < sum) {
                    sum = -1;
                }else {
                    sum *= next;
                }
            } if(1000000000000000000L / next < sum) {
                    sum = -1;
                }else {
                    sum *= next;
                } 1000000000000000000L / next < sum 1000000000000000000L / next 1000000000000000000L next sum {
                    sum = -1;
                } sum = -1 sum -1 1 {
                    sum *= next;
                } sum *= next sum next {
                continue;
            } continue; System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        long sum = 1;
        for(int i=0; i<N; i++) {
            long next = Long.parseLong(sc.next());
            if(next == 0) {
                sum = 0;
                break;
            }
            if(sum != -1) {
                if(1000000000000000000L / next < sum) {
                    sum = -1;
                }else {
                    sum *= next;
                }
            }else {
                continue;
            }
        }
        System.out.println(sum);
        
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        long sum = 1;
        for(int i=0; i<N; i++) {
            long next = Long.parseLong(sc.next());
            if(next == 0) {
                sum = 0;
                break;
            }
            if(sum != -1) {
                if(1000000000000000000L / next < sum) {
                    sum = -1;
                }else {
                    sum *= next;
                }
            }else {
                continue;
            }
        }
        System.out.println(sum);
        
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        long sum = 1;
        for(int i=0; i<N; i++) {
            long next = Long.parseLong(sc.next());
            if(next == 0) {
                sum = 0;
                break;
            }
            if(sum != -1) {
                if(1000000000000000000L / next < sum) {
                    sum = -1;
                }else {
                    sum *= next;
                }
            }else {
                continue;
            }
        }
        System.out.println(sum);
        
    }
}
