import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Deque;
import java.util.Queue;
import java.util.Scanner;
 


public class Main {
	private static Scanner sc = new Scanner(System.in);
	//StringBuffer S = new StringBuffer(sc.next());
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)
	//Map<Integer, Integer> map = new HashMap<Integer, Integer>(N);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> dd=new ArrayDeque<>();//push後ろに入れる,poll(pop)後ろからとる,peek addは先頭に入るからバグ注意
	//ArrayList<Integer> cc = new ArrayList<>(N);
	//cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	static long mod =1000000007;
	static long longINF=1000000000000000007L;
	static int INF=1000000007;

	
	public static void main(String[] args) {
		//StringBuffer str = new StringBuffer(sc.nextInt());
		//for(int i=0;i<N;i++) {}
		
			
		
		
		
		int N=sc.nextInt();
		boolean xx=false;
		long s=1;
		long a[]=new long[N];
		boolean x=true;
		for(int i=0;i<N;i++) 
		{a[i]=sc.nextLong();
		if(a[i]==0)xx=true;
		}
		for(int i=0;i<N&&!xx;i++) {
			//p((s+"").length()+(a[i]+"").length()-1);
			if((s+"").length()+(a[i]+"").length()-1>18&&(a[i]*s!=1000000000000000000L)) {
				x=false;
				break;
			}
			
			s*=a[i];
			
			if(s>1000000000000000000L||s<0) {
				x=false;
				break;
			}
			
			
		}
		if(xx)p(0);
		else if(x)p(s);
		else p(-1);
		
		//String S=sc.next();
		
		
		
		
		
		
		
		
	}
		
		
		
		
		
	
	
	
	static long bi(int i) {
		long t=1;
		for(int a=1;a<=i;a++) {
			t*=a;
			t%=mod;
		}
		return t;
	}
	public static long modPow(long g,long N) {
		long T=1;
		for(int i=0;i<N;i++) {
			T*=g;
			T%=mod;
		}
		return T;
	}
	static void bit() {
		int n=3;
		String[] ar = {"a","b","c"};
		for(int i =0;i<(1<<n);i++) {
			String S="";
			for(int j=0;j<n;j++) {
				if((1&i>>j)==1) {
					S+=ar[j];
				}
			}
			p("S="+S);
		}
	}
	public static long lcm(long a, long b) {
        return a / gcd(a, b) * b;
	}
	
	public static long gcd(long a, long b) {
        return b == 0 ? a: gcd(b, a % b);
	}
	static String nextPermutation(String s) {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	}
	


	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	
}
	 import java.util.ArrayDeque; ArrayDeque java.util import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.Deque; Deque java.util import java.util.Queue; Queue java.util import java.util.Scanner; Scanner java.util public class Main {
	private static Scanner sc = new Scanner(System.in);
	//StringBuffer S = new StringBuffer(sc.next());
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)
	//Map<Integer, Integer> map = new HashMap<Integer, Integer>(N);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> dd=new ArrayDeque<>();//push後ろに入れる,poll(pop)後ろからとる,peek addは先頭に入るからバグ注意
	//ArrayList<Integer> cc = new ArrayList<>(N);
	//cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	static long mod =1000000007;
	static long longINF=1000000000000000007L;
	static int INF=1000000007;

	
	public static void main(String[] args) {
		//StringBuffer str = new StringBuffer(sc.nextInt());
		//for(int i=0;i<N;i++) {}
		
			
		
		
		
		int N=sc.nextInt();
		boolean xx=false;
		long s=1;
		long a[]=new long[N];
		boolean x=true;
		for(int i=0;i<N;i++) 
		{a[i]=sc.nextLong();
		if(a[i]==0)xx=true;
		}
		for(int i=0;i<N&&!xx;i++) {
			//p((s+"").length()+(a[i]+"").length()-1);
			if((s+"").length()+(a[i]+"").length()-1>18&&(a[i]*s!=1000000000000000000L)) {
				x=false;
				break;
			}
			
			s*=a[i];
			
			if(s>1000000000000000000L||s<0) {
				x=false;
				break;
			}
			
			
		}
		if(xx)p(0);
		else if(x)p(s);
		else p(-1);
		
		//String S=sc.next();
		
		
		
		
		
		
		
		
	}
		
		
		
		
		
	
	
	
	static long bi(int i) {
		long t=1;
		for(int a=1;a<=i;a++) {
			t*=a;
			t%=mod;
		}
		return t;
	}
	public static long modPow(long g,long N) {
		long T=1;
		for(int i=0;i<N;i++) {
			T*=g;
			T%=mod;
		}
		return T;
	}
	static void bit() {
		int n=3;
		String[] ar = {"a","b","c"};
		for(int i =0;i<(1<<n);i++) {
			String S="";
			for(int j=0;j<n;j++) {
				if((1&i>>j)==1) {
					S+=ar[j];
				}
			}
			p("S="+S);
		}
	}
	public static long lcm(long a, long b) {
        return a / gcd(a, b) * b;
	}
	
	public static long gcd(long a, long b) {
        return b == 0 ? a: gcd(b, a % b);
	}
	static String nextPermutation(String s) {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	}
	


	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	
} Main private static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) //StringBuffer S = new StringBuffer(sc.next());
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)
	//Map<Integer, Integer> map = new HashMap<Integer, Integer>(N);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> dd=new ArrayDeque<>();//push後ろに入れる,poll(pop)後ろからとる,peek addは先頭に入るからバグ注意
	//ArrayList<Integer> cc = new ArrayList<>(N);
	//cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	static long mod =1000000007; mod 1000000007 static long longINF=1000000000000000007L; longINF 1000000000000000007L static int INF=1000000007; INF 1000000007 public static void main(String[] args) {
		//StringBuffer str = new StringBuffer(sc.nextInt());
		//for(int i=0;i<N;i++) {}
		
			
		
		
		
		int N=sc.nextInt();
		boolean xx=false;
		long s=1;
		long a[]=new long[N];
		boolean x=true;
		for(int i=0;i<N;i++) 
		{a[i]=sc.nextLong();
		if(a[i]==0)xx=true;
		}
		for(int i=0;i<N&&!xx;i++) {
			//p((s+"").length()+(a[i]+"").length()-1);
			if((s+"").length()+(a[i]+"").length()-1>18&&(a[i]*s!=1000000000000000000L)) {
				x=false;
				break;
			}
			
			s*=a[i];
			
			if(s>1000000000000000000L||s<0) {
				x=false;
				break;
			}
			
			
		}
		if(xx)p(0);
		else if(x)p(s);
		else p(-1);
		
		//String S=sc.next();
		
		
		
		
		
		
		
		
	} main {
		//StringBuffer str = new StringBuffer(sc.nextInt());
		//for(int i=0;i<N;i++) {}
		
			
		
		
		
		int N=sc.nextInt();
		boolean xx=false;
		long s=1;
		long a[]=new long[N];
		boolean x=true;
		for(int i=0;i<N;i++) 
		{a[i]=sc.nextLong();
		if(a[i]==0)xx=true;
		}
		for(int i=0;i<N&&!xx;i++) {
			//p((s+"").length()+(a[i]+"").length()-1);
			if((s+"").length()+(a[i]+"").length()-1>18&&(a[i]*s!=1000000000000000000L)) {
				x=false;
				break;
			}
			
			s*=a[i];
			
			if(s>1000000000000000000L||s<0) {
				x=false;
				break;
			}
			
			
		}
		if(xx)p(0);
		else if(x)p(s);
		else p(-1);
		
		//String S=sc.next();
		
		
		
		
		
		
		
		
	} int N=sc.nextInt(); N sc.nextInt() sc.nextInt sc boolean xx=false; xx false long s=1; s 1 long a[]=new long[N]; a new long[N] N boolean x=true; x true for(int i=0;i<N;i++) 
		{a[i]=sc.nextLong();
		if(a[i]==0)xx=true;
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {a[i]=sc.nextLong();
		if(a[i]==0)xx=true;
		} {a[i]=sc.nextLong();
		if(a[i]==0)xx=true;
		} a[i]=sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc if(a[i]==0)xx=true; a[i]==0 a[i] a i 0 xx=true xx true for(int i=0;i<N&&!xx;i++) {
			//p((s+"").length()+(a[i]+"").length()-1);
			if((s+"").length()+(a[i]+"").length()-1>18&&(a[i]*s!=1000000000000000000L)) {
				x=false;
				break;
			}
			
			s*=a[i];
			
			if(s>1000000000000000000L||s<0) {
				x=false;
				break;
			}
			
			
		} int i=0; int i=0; i 0 i<N&&!xx i<N i N !xx xx i++ i++ i {
			//p((s+"").length()+(a[i]+"").length()-1);
			if((s+"").length()+(a[i]+"").length()-1>18&&(a[i]*s!=1000000000000000000L)) {
				x=false;
				break;
			}
			
			s*=a[i];
			
			if(s>1000000000000000000L||s<0) {
				x=false;
				break;
			}
			
			
		} {
			//p((s+"").length()+(a[i]+"").length()-1);
			if((s+"").length()+(a[i]+"").length()-1>18&&(a[i]*s!=1000000000000000000L)) {
				x=false;
				break;
			}
			
			s*=a[i];
			
			if(s>1000000000000000000L||s<0) {
				x=false;
				break;
			}
			
			
		} if((s+"").length()+(a[i]+"").length()-1>18&&(a[i]*s!=1000000000000000000L)) {
				x=false;
				break;
			} (s+"").length()+(a[i]+"").length()-1>18&&(a[i]*s!=1000000000000000000L) (s+"").length()+(a[i]+"").length()-1>18 (s+"").length()+(a[i]+"").length()-1 (s+"").length()+(a[i]+"").length() (s+"").length() (s+"").length (s+"") s "" (a[i]+"").length() (a[i]+"").length (a[i]+"") a[i] a i "" 1 18 (a[i]*s!=1000000000000000000L) a[i]*s a[i] a i s 1000000000000000000L {
				x=false;
				break;
			} x=false x false break; s*=a[i] s a[i] a i if(s>1000000000000000000L||s<0) {
				x=false;
				break;
			} s>1000000000000000000L||s<0 s>1000000000000000000L s 1000000000000000000L s<0 s 0 {
				x=false;
				break;
			} x=false x false break; if(xx)p(0);
		else if(x)p(s);
		else p(-1); xx p(0) p 0 if(x)p(s);
		else p(-1); x p(s) p s p(-1) p -1 1 String[] args args static long bi(int i) {
		long t=1;
		for(int a=1;a<=i;a++) {
			t*=a;
			t%=mod;
		}
		return t;
	} bi {
		long t=1;
		for(int a=1;a<=i;a++) {
			t*=a;
			t%=mod;
		}
		return t;
	} long t=1; t 1 for(int a=1;a<=i;a++) {
			t*=a;
			t%=mod;
		} int a=1; int a=1; a 1 a<=i a i a++ a++ a {
			t*=a;
			t%=mod;
		} {
			t*=a;
			t%=mod;
		} t*=a t a t%=mod t mod return t; t int i i public static long modPow(long g,long N) {
		long T=1;
		for(int i=0;i<N;i++) {
			T*=g;
			T%=mod;
		}
		return T;
	} modPow {
		long T=1;
		for(int i=0;i<N;i++) {
			T*=g;
			T%=mod;
		}
		return T;
	} long T=1; T 1 for(int i=0;i<N;i++) {
			T*=g;
			T%=mod;
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			T*=g;
			T%=mod;
		} {
			T*=g;
			T%=mod;
		} T*=g T g T%=mod T mod return T; T long g g long N N static void bit() {
		int n=3;
		String[] ar = {"a","b","c"};
		for(int i =0;i<(1<<n);i++) {
			String S="";
			for(int j=0;j<n;j++) {
				if((1&i>>j)==1) {
					S+=ar[j];
				}
			}
			p("S="+S);
		}
	} bit {
		int n=3;
		String[] ar = {"a","b","c"};
		for(int i =0;i<(1<<n);i++) {
			String S="";
			for(int j=0;j<n;j++) {
				if((1&i>>j)==1) {
					S+=ar[j];
				}
			}
			p("S="+S);
		}
	} int n=3; n 3 String[] ar = {"a","b","c"}; ar {"a","b","c"} "a" "b" "c" for(int i =0;i<(1<<n);i++) {
			String S="";
			for(int j=0;j<n;j++) {
				if((1&i>>j)==1) {
					S+=ar[j];
				}
			}
			p("S="+S);
		} int i =0; int i =0; i 0 i<(1<<n) i (1<<n) 1 n i++ i++ i {
			String S="";
			for(int j=0;j<n;j++) {
				if((1&i>>j)==1) {
					S+=ar[j];
				}
			}
			p("S="+S);
		} {
			String S="";
			for(int j=0;j<n;j++) {
				if((1&i>>j)==1) {
					S+=ar[j];
				}
			}
			p("S="+S);
		} String S=""; S "" for(int j=0;j<n;j++) {
				if((1&i>>j)==1) {
					S+=ar[j];
				}
			} int j=0; int j=0; j 0 j<n j n j++ j++ j {
				if((1&i>>j)==1) {
					S+=ar[j];
				}
			} {
				if((1&i>>j)==1) {
					S+=ar[j];
				}
			} if((1&i>>j)==1) {
					S+=ar[j];
				} (1&i>>j)==1 (1&i>>j) 1 i>>j i j 1 {
					S+=ar[j];
				} S+=ar[j] S ar[j] ar j p("S="+S) p "S="+S "S=" S public static long lcm(long a, long b) {
        return a / gcd(a, b) * b;
	} lcm {
        return a / gcd(a, b) * b;
	} return a / gcd(a, b) * b; a / gcd(a, b) * b a / gcd(a, b) a gcd(a, b) gcd a b b long a a long b b public static long gcd(long a, long b) {
        return b == 0 ? a: gcd(b, a % b);
	} gcd {
        return b == 0 ? a: gcd(b, a % b);
	} return b == 0 ? a: gcd(b, a % b); b == 0 ? a: gcd(b, a % b) b == 0 b 0 a gcd(b, a % b) gcd b a % b a b long a a long b b static String nextPermutation(String s) {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	} nextPermutation {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	} ArrayList<Character> list=new ArrayList<>(); list new ArrayList<>() for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			list.add(s.charAt(i));
		} {
			list.add(s.charAt(i));
		} list.add(s.charAt(i)) list.add list s.charAt(i) s.charAt s i int pivotPos=-1; pivotPos -1 1 char pivot=0; pivot 0 for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		} int i=list.size()-2; int i=list.size()-2; i list.size()-2 list.size() list.size list 2 i>=0 i 0 i-- i-- i {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		} {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		} if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			} list.get(i)<list.get(i+1) list.get(i) list.get list i list.get(i+1) list.get list i+1 i 1 {
				pivotPos=i;
				pivot=list.get(i);
				break;
			} pivotPos=i pivotPos i pivot=list.get(i) pivot list.get(i) list.get list i break; if(pivotPos==-1&&pivot==0) {
			return "Final";
		} pivotPos==-1&&pivot==0 pivotPos==-1 pivotPos -1 1 pivot==0 pivot 0 {
			return "Final";
		} return "Final"; "Final" int L=pivotPos+1 L pivotPos+1 pivotPos 1 R=list.size()-1; R list.size()-1 list.size() list.size list 1 int minPos=-1; minPos -1 1 char min =Character.MAX_VALUE; min Character.MAX_VALUE Character Character.MAX_VALUE for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		} int i=R; int i=R; i R i>=L i L i-- i-- i {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		} {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		} if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			} pivot<list.get(i) pivot list.get(i) list.get list i {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			} if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				} list.get(i)<min list.get(i) list.get list i min {
					min=list.get(i);
					minPos=i;
				} min=list.get(i) min list.get(i) list.get list i minPos=i minPos i Collections.swap(list, pivotPos, minPos) Collections.swap Collections list pivotPos minPos Collections.sort(list.subList(L, R+1)) Collections.sort Collections list.subList(L, R+1) list.subList list L R+1 R 1 StringBuilder sb=new StringBuilder(); sb new StringBuilder() for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		} int i=0; int i=0; i 0 i<list.size() i list.size() list.size list i++ i++ i {
			sb.append(list.get(i));
		} {
			sb.append(list.get(i));
		} sb.append(list.get(i)) sb.append sb list.get(i) list.get list i return sb.toString(); sb.toString() sb.toString sb String s s static void p(String ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans String ans ans static void p(int ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans int ans ans static void p() {System.out.println();} p {System.out.println();} System.out.println() System.out.println System.out System System.out static void p(long ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans long ans ans static void p(double ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans double ans ans public class Main {
	private static Scanner sc = new Scanner(System.in);
	//StringBuffer S = new StringBuffer(sc.next());
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)
	//Map<Integer, Integer> map = new HashMap<Integer, Integer>(N);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> dd=new ArrayDeque<>();//push後ろに入れる,poll(pop)後ろからとる,peek addは先頭に入るからバグ注意
	//ArrayList<Integer> cc = new ArrayList<>(N);
	//cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	static long mod =1000000007;
	static long longINF=1000000000000000007L;
	static int INF=1000000007;

	
	public static void main(String[] args) {
		//StringBuffer str = new StringBuffer(sc.nextInt());
		//for(int i=0;i<N;i++) {}
		
			
		
		
		
		int N=sc.nextInt();
		boolean xx=false;
		long s=1;
		long a[]=new long[N];
		boolean x=true;
		for(int i=0;i<N;i++) 
		{a[i]=sc.nextLong();
		if(a[i]==0)xx=true;
		}
		for(int i=0;i<N&&!xx;i++) {
			//p((s+"").length()+(a[i]+"").length()-1);
			if((s+"").length()+(a[i]+"").length()-1>18&&(a[i]*s!=1000000000000000000L)) {
				x=false;
				break;
			}
			
			s*=a[i];
			
			if(s>1000000000000000000L||s<0) {
				x=false;
				break;
			}
			
			
		}
		if(xx)p(0);
		else if(x)p(s);
		else p(-1);
		
		//String S=sc.next();
		
		
		
		
		
		
		
		
	}
		
		
		
		
		
	
	
	
	static long bi(int i) {
		long t=1;
		for(int a=1;a<=i;a++) {
			t*=a;
			t%=mod;
		}
		return t;
	}
	public static long modPow(long g,long N) {
		long T=1;
		for(int i=0;i<N;i++) {
			T*=g;
			T%=mod;
		}
		return T;
	}
	static void bit() {
		int n=3;
		String[] ar = {"a","b","c"};
		for(int i =0;i<(1<<n);i++) {
			String S="";
			for(int j=0;j<n;j++) {
				if((1&i>>j)==1) {
					S+=ar[j];
				}
			}
			p("S="+S);
		}
	}
	public static long lcm(long a, long b) {
        return a / gcd(a, b) * b;
	}
	
	public static long gcd(long a, long b) {
        return b == 0 ? a: gcd(b, a % b);
	}
	static String nextPermutation(String s) {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	}
	


	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	
} public class Main {
	private static Scanner sc = new Scanner(System.in);
	//StringBuffer S = new StringBuffer(sc.next());
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)
	//Map<Integer, Integer> map = new HashMap<Integer, Integer>(N);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> dd=new ArrayDeque<>();//push後ろに入れる,poll(pop)後ろからとる,peek addは先頭に入るからバグ注意
	//ArrayList<Integer> cc = new ArrayList<>(N);
	//cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	static long mod =1000000007;
	static long longINF=1000000000000000007L;
	static int INF=1000000007;

	
	public static void main(String[] args) {
		//StringBuffer str = new StringBuffer(sc.nextInt());
		//for(int i=0;i<N;i++) {}
		
			
		
		
		
		int N=sc.nextInt();
		boolean xx=false;
		long s=1;
		long a[]=new long[N];
		boolean x=true;
		for(int i=0;i<N;i++) 
		{a[i]=sc.nextLong();
		if(a[i]==0)xx=true;
		}
		for(int i=0;i<N&&!xx;i++) {
			//p((s+"").length()+(a[i]+"").length()-1);
			if((s+"").length()+(a[i]+"").length()-1>18&&(a[i]*s!=1000000000000000000L)) {
				x=false;
				break;
			}
			
			s*=a[i];
			
			if(s>1000000000000000000L||s<0) {
				x=false;
				break;
			}
			
			
		}
		if(xx)p(0);
		else if(x)p(s);
		else p(-1);
		
		//String S=sc.next();
		
		
		
		
		
		
		
		
	}
		
		
		
		
		
	
	
	
	static long bi(int i) {
		long t=1;
		for(int a=1;a<=i;a++) {
			t*=a;
			t%=mod;
		}
		return t;
	}
	public static long modPow(long g,long N) {
		long T=1;
		for(int i=0;i<N;i++) {
			T*=g;
			T%=mod;
		}
		return T;
	}
	static void bit() {
		int n=3;
		String[] ar = {"a","b","c"};
		for(int i =0;i<(1<<n);i++) {
			String S="";
			for(int j=0;j<n;j++) {
				if((1&i>>j)==1) {
					S+=ar[j];
				}
			}
			p("S="+S);
		}
	}
	public static long lcm(long a, long b) {
        return a / gcd(a, b) * b;
	}
	
	public static long gcd(long a, long b) {
        return b == 0 ? a: gcd(b, a % b);
	}
	static String nextPermutation(String s) {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	}
	


	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	
} Main
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Deque;
import java.util.Queue;
import java.util.Scanner;
 


public class Main {
	private static Scanner sc = new Scanner(System.in);
	//StringBuffer S = new StringBuffer(sc.next());
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)
	//Map<Integer, Integer> map = new HashMap<Integer, Integer>(N);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> dd=new ArrayDeque<>();//push後ろに入れる,poll(pop)後ろからとる,peek addは先頭に入るからバグ注意
	//ArrayList<Integer> cc = new ArrayList<>(N);
	//cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	static long mod =1000000007;
	static long longINF=1000000000000000007L;
	static int INF=1000000007;

	
	public static void main(String[] args) {
		//StringBuffer str = new StringBuffer(sc.nextInt());
		//for(int i=0;i<N;i++) {}
		
			
		
		
		
		int N=sc.nextInt();
		boolean xx=false;
		long s=1;
		long a[]=new long[N];
		boolean x=true;
		for(int i=0;i<N;i++) 
		{a[i]=sc.nextLong();
		if(a[i]==0)xx=true;
		}
		for(int i=0;i<N&&!xx;i++) {
			//p((s+"").length()+(a[i]+"").length()-1);
			if((s+"").length()+(a[i]+"").length()-1>18&&(a[i]*s!=1000000000000000000L)) {
				x=false;
				break;
			}
			
			s*=a[i];
			
			if(s>1000000000000000000L||s<0) {
				x=false;
				break;
			}
			
			
		}
		if(xx)p(0);
		else if(x)p(s);
		else p(-1);
		
		//String S=sc.next();
		
		
		
		
		
		
		
		
	}
		
		
		
		
		
	
	
	
	static long bi(int i) {
		long t=1;
		for(int a=1;a<=i;a++) {
			t*=a;
			t%=mod;
		}
		return t;
	}
	public static long modPow(long g,long N) {
		long T=1;
		for(int i=0;i<N;i++) {
			T*=g;
			T%=mod;
		}
		return T;
	}
	static void bit() {
		int n=3;
		String[] ar = {"a","b","c"};
		for(int i =0;i<(1<<n);i++) {
			String S="";
			for(int j=0;j<n;j++) {
				if((1&i>>j)==1) {
					S+=ar[j];
				}
			}
			p("S="+S);
		}
	}
	public static long lcm(long a, long b) {
        return a / gcd(a, b) * b;
	}
	
	public static long gcd(long a, long b) {
        return b == 0 ? a: gcd(b, a % b);
	}
	static String nextPermutation(String s) {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	}
	


	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	
}
	
