import java.util.*;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        long mx = (long)Math.pow(10, 18);
        
        long ans = 1;
        for(int i = 0; i < n; i++) {
            long next = sc.nextLong();
            if(next == 0) {
                ans = 0;
                break;
            }
            if(ans == -1) continue;
            if(ans > mx/next || ans*next > mx) {
                ans = -1;
            } else {
                ans *= next;
            }
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        long mx = (long)Math.pow(10, 18);
        
        long ans = 1;
        for(int i = 0; i < n; i++) {
            long next = sc.nextLong();
            if(next == 0) {
                ans = 0;
                break;
            }
            if(ans == -1) continue;
            if(ans > mx/next || ans*next > mx) {
                ans = -1;
            } else {
                ans *= next;
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        long mx = (long)Math.pow(10, 18);
        
        long ans = 1;
        for(int i = 0; i < n; i++) {
            long next = sc.nextLong();
            if(next == 0) {
                ans = 0;
                break;
            }
            if(ans == -1) continue;
            if(ans > mx/next || ans*next > mx) {
                ans = -1;
            } else {
                ans *= next;
            }
        }
        System.out.println(ans);
    } main {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        long mx = (long)Math.pow(10, 18);
        
        long ans = 1;
        for(int i = 0; i < n; i++) {
            long next = sc.nextLong();
            if(next == 0) {
                ans = 0;
                break;
            }
            if(ans == -1) continue;
            if(ans > mx/next || ans*next > mx) {
                ans = -1;
            } else {
                ans *= next;
            }
        }
        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 long mx = (long)Math.pow(10, 18); mx (long)Math.pow(10, 18) Math.pow Math 10 18 long ans = 1; ans 1 for(int i = 0; i < n; i++) {
            long next = sc.nextLong();
            if(next == 0) {
                ans = 0;
                break;
            }
            if(ans == -1) continue;
            if(ans > mx/next || ans*next > mx) {
                ans = -1;
            } else {
                ans *= next;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            long next = sc.nextLong();
            if(next == 0) {
                ans = 0;
                break;
            }
            if(ans == -1) continue;
            if(ans > mx/next || ans*next > mx) {
                ans = -1;
            } else {
                ans *= next;
            }
        } {
            long next = sc.nextLong();
            if(next == 0) {
                ans = 0;
                break;
            }
            if(ans == -1) continue;
            if(ans > mx/next || ans*next > mx) {
                ans = -1;
            } else {
                ans *= next;
            }
        } long next = sc.nextLong(); next sc.nextLong() sc.nextLong sc if(next == 0) {
                ans = 0;
                break;
            } next == 0 next 0 {
                ans = 0;
                break;
            } ans = 0 ans 0 break; if(ans == -1) continue; ans == -1 ans -1 1 continue; if(ans > mx/next || ans*next > mx) {
                ans = -1;
            } else {
                ans *= next;
            } ans > mx/next || ans*next > mx ans > mx/next ans mx/next mx next ans*next > mx ans*next ans next mx {
                ans = -1;
            } ans = -1 ans -1 1 {
                ans *= next;
            } ans *= next ans next 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();
        
        long mx = (long)Math.pow(10, 18);
        
        long ans = 1;
        for(int i = 0; i < n; i++) {
            long next = sc.nextLong();
            if(next == 0) {
                ans = 0;
                break;
            }
            if(ans == -1) continue;
            if(ans > mx/next || ans*next > mx) {
                ans = -1;
            } else {
                ans *= next;
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        long mx = (long)Math.pow(10, 18);
        
        long ans = 1;
        for(int i = 0; i < n; i++) {
            long next = sc.nextLong();
            if(next == 0) {
                ans = 0;
                break;
            }
            if(ans == -1) continue;
            if(ans > mx/next || ans*next > mx) {
                ans = -1;
            } else {
                ans *= next;
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        long mx = (long)Math.pow(10, 18);
        
        long ans = 1;
        for(int i = 0; i < n; i++) {
            long next = sc.nextLong();
            if(next == 0) {
                ans = 0;
                break;
            }
            if(ans == -1) continue;
            if(ans > mx/next || ans*next > mx) {
                ans = -1;
            } else {
                ans *= next;
            }
        }
        System.out.println(ans);
    }
}