

import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);

		long num = s.nextLong();
		long mul = 1;
		ArrayList<Long> inputs = new ArrayList<>();
		for (int i = 0; i < num; i++) {
			inputs.add(s.nextLong());
		}
		
		Collections.sort(inputs);
					
		if (inputs.get(0) == 0) {
			    System.out.println(0);
			    System.exit(0);
		
		}
		
		for(long l:inputs) {
			
			mul *= l;
			
            if (mul < l) {
    			System.out.println(-1);
    			System.exit(0);
            }	
		}
		

		if (mul > 1000000000000000000L) {
			System.out.println(-1);
		}

		else {
			System.out.println(mul);
		}
		

	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);

		long num = s.nextLong();
		long mul = 1;
		ArrayList<Long> inputs = new ArrayList<>();
		for (int i = 0; i < num; i++) {
			inputs.add(s.nextLong());
		}
		
		Collections.sort(inputs);
					
		if (inputs.get(0) == 0) {
			    System.out.println(0);
			    System.exit(0);
		
		}
		
		for(long l:inputs) {
			
			mul *= l;
			
            if (mul < l) {
    			System.out.println(-1);
    			System.exit(0);
            }	
		}
		

		if (mul > 1000000000000000000L) {
			System.out.println(-1);
		}

		else {
			System.out.println(mul);
		}
		

	}

} Main public static void main(String[] args) {
		Scanner s = new Scanner(System.in);

		long num = s.nextLong();
		long mul = 1;
		ArrayList<Long> inputs = new ArrayList<>();
		for (int i = 0; i < num; i++) {
			inputs.add(s.nextLong());
		}
		
		Collections.sort(inputs);
					
		if (inputs.get(0) == 0) {
			    System.out.println(0);
			    System.exit(0);
		
		}
		
		for(long l:inputs) {
			
			mul *= l;
			
            if (mul < l) {
    			System.out.println(-1);
    			System.exit(0);
            }	
		}
		

		if (mul > 1000000000000000000L) {
			System.out.println(-1);
		}

		else {
			System.out.println(mul);
		}
		

	} main {
		Scanner s = new Scanner(System.in);

		long num = s.nextLong();
		long mul = 1;
		ArrayList<Long> inputs = new ArrayList<>();
		for (int i = 0; i < num; i++) {
			inputs.add(s.nextLong());
		}
		
		Collections.sort(inputs);
					
		if (inputs.get(0) == 0) {
			    System.out.println(0);
			    System.exit(0);
		
		}
		
		for(long l:inputs) {
			
			mul *= l;
			
            if (mul < l) {
    			System.out.println(-1);
    			System.exit(0);
            }	
		}
		

		if (mul > 1000000000000000000L) {
			System.out.println(-1);
		}

		else {
			System.out.println(mul);
		}
		

	} Scanner s = new Scanner(System.in); s new Scanner(System.in) long num = s.nextLong(); num s.nextLong() s.nextLong s long mul = 1; mul 1 ArrayList<Long> inputs = new ArrayList<>(); inputs new ArrayList<>() for (int i = 0; i < num; i++) {
			inputs.add(s.nextLong());
		} int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
			inputs.add(s.nextLong());
		} {
			inputs.add(s.nextLong());
		} inputs.add(s.nextLong()) inputs.add inputs s.nextLong() s.nextLong s Collections.sort(inputs) Collections.sort Collections inputs if (inputs.get(0) == 0) {
			    System.out.println(0);
			    System.exit(0);
		
		} inputs.get(0) == 0 inputs.get(0) inputs.get inputs 0 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 for(long l:inputs) {
			
			mul *= l;
			
            if (mul < l) {
    			System.out.println(-1);
    			System.exit(0);
            }	
		} long l inputs {
			
			mul *= l;
			
            if (mul < l) {
    			System.out.println(-1);
    			System.exit(0);
            }	
		} {
			
			mul *= l;
			
            if (mul < l) {
    			System.out.println(-1);
    			System.exit(0);
            }	
		} mul *= l mul l if (mul < l) {
    			System.out.println(-1);
    			System.exit(0);
            } mul < l mul l {
    			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 if (mul > 1000000000000000000L) {
			System.out.println(-1);
		}

		else {
			System.out.println(mul);
		} mul > 1000000000000000000L mul 1000000000000000000L {
			System.out.println(-1);
		} System.out.println(-1) System.out.println System.out System System.out -1 1 {
			System.out.println(mul);
		} System.out.println(mul) System.out.println System.out System System.out mul String[] args args public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);

		long num = s.nextLong();
		long mul = 1;
		ArrayList<Long> inputs = new ArrayList<>();
		for (int i = 0; i < num; i++) {
			inputs.add(s.nextLong());
		}
		
		Collections.sort(inputs);
					
		if (inputs.get(0) == 0) {
			    System.out.println(0);
			    System.exit(0);
		
		}
		
		for(long l:inputs) {
			
			mul *= l;
			
            if (mul < l) {
    			System.out.println(-1);
    			System.exit(0);
            }	
		}
		

		if (mul > 1000000000000000000L) {
			System.out.println(-1);
		}

		else {
			System.out.println(mul);
		}
		

	}

} public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);

		long num = s.nextLong();
		long mul = 1;
		ArrayList<Long> inputs = new ArrayList<>();
		for (int i = 0; i < num; i++) {
			inputs.add(s.nextLong());
		}
		
		Collections.sort(inputs);
					
		if (inputs.get(0) == 0) {
			    System.out.println(0);
			    System.exit(0);
		
		}
		
		for(long l:inputs) {
			
			mul *= l;
			
            if (mul < l) {
    			System.out.println(-1);
    			System.exit(0);
            }	
		}
		

		if (mul > 1000000000000000000L) {
			System.out.println(-1);
		}

		else {
			System.out.println(mul);
		}
		

	}

} Main


import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);

		long num = s.nextLong();
		long mul = 1;
		ArrayList<Long> inputs = new ArrayList<>();
		for (int i = 0; i < num; i++) {
			inputs.add(s.nextLong());
		}
		
		Collections.sort(inputs);
					
		if (inputs.get(0) == 0) {
			    System.out.println(0);
			    System.exit(0);
		
		}
		
		for(long l:inputs) {
			
			mul *= l;
			
            if (mul < l) {
    			System.out.println(-1);
    			System.exit(0);
            }	
		}
		

		if (mul > 1000000000000000000L) {
			System.out.println(-1);
		}

		else {
			System.out.println(mul);
		}
		

	}

}
