import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		long n = sc.nextLong();
		long result = 1;
		boolean flg = false;
		for(int i = 0; i < n; i++){
		    long a = sc.nextLong();
		    try{
		        result = multiplyExact(result, a);
		    }catch(Exception e){
		        flg = true;
		        result = 1;
		    }
		}
		if(result > 1000000000000000000L) result = -1;
		if(flg && result != 0) result = -1;
		
		// 計算
		//int result = 0;
		
		// 出力
		System.out.println(result);
	}

	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
} import java.util.*; util.* java import java.io.*; io.* java import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		long n = sc.nextLong();
		long result = 1;
		boolean flg = false;
		for(int i = 0; i < n; i++){
		    long a = sc.nextLong();
		    try{
		        result = multiplyExact(result, a);
		    }catch(Exception e){
		        flg = true;
		        result = 1;
		    }
		}
		if(result > 1000000000000000000L) result = -1;
		if(flg && result != 0) result = -1;
		
		// 計算
		//int result = 0;
		
		// 出力
		System.out.println(result);
	}

	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		long n = sc.nextLong();
		long result = 1;
		boolean flg = false;
		for(int i = 0; i < n; i++){
		    long a = sc.nextLong();
		    try{
		        result = multiplyExact(result, a);
		    }catch(Exception e){
		        flg = true;
		        result = 1;
		    }
		}
		if(result > 1000000000000000000L) result = -1;
		if(flg && result != 0) result = -1;
		
		// 計算
		//int result = 0;
		
		// 出力
		System.out.println(result);
	} main {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		long n = sc.nextLong();
		long result = 1;
		boolean flg = false;
		for(int i = 0; i < n; i++){
		    long a = sc.nextLong();
		    try{
		        result = multiplyExact(result, a);
		    }catch(Exception e){
		        flg = true;
		        result = 1;
		    }
		}
		if(result > 1000000000000000000L) result = -1;
		if(flg && result != 0) result = -1;
		
		// 計算
		//int result = 0;
		
		// 出力
		System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long result = 1; result 1 boolean flg = false; flg false for(int i = 0; i < n; i++){
		    long a = sc.nextLong();
		    try{
		        result = multiplyExact(result, a);
		    }catch(Exception e){
		        flg = true;
		        result = 1;
		    }
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
		    long a = sc.nextLong();
		    try{
		        result = multiplyExact(result, a);
		    }catch(Exception e){
		        flg = true;
		        result = 1;
		    }
		} {
		    long a = sc.nextLong();
		    try{
		        result = multiplyExact(result, a);
		    }catch(Exception e){
		        flg = true;
		        result = 1;
		    }
		} long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc try{
		        result = multiplyExact(result, a);
		    }catch(Exception e){
		        flg = true;
		        result = 1;
		    } catch(Exception e){
		        flg = true;
		        result = 1;
		    } Exception e {
		        flg = true;
		        result = 1;
		    } flg = true flg true result = 1 result 1 {
		        result = multiplyExact(result, a);
		    } result = multiplyExact(result, a) result multiplyExact(result, a) multiplyExact result a if(result > 1000000000000000000L) result = -1; result > 1000000000000000000L result 1000000000000000000L result = -1 result -1 1 if(flg && result != 0) result = -1; flg && result != 0 flg result != 0 result 0 result = -1 result -1 1 System.out.println(result) System.out.println System.out System System.out result String[] args args public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	} Scanner private BufferedReader br; br private StringTokenizer tok; tok public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));} Scanner { br = new BufferedReader(new InputStreamReader(is));} br = new BufferedReader(new InputStreamReader(is)) br new BufferedReader(new InputStreamReader(is)) InputStream is is private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());} getLine { while(!hasNext()) tok = new StringTokenizer(br.readLine());} while(!hasNext()) tok = new StringTokenizer(br.readLine()); !hasNext() hasNext() hasNext tok = new StringTokenizer(br.readLine()) tok new StringTokenizer(br.readLine()) private boolean hasNext() { return tok != null && tok.hasMoreTokens();} hasNext { return tok != null && tok.hasMoreTokens();} return tok != null && tok.hasMoreTokens(); tok != null && tok.hasMoreTokens() tok != null tok null tok.hasMoreTokens() tok.hasMoreTokens tok public String next() throws IOException { getLine(); return tok.nextToken();} next { getLine(); return tok.nextToken();} getLine() getLine return tok.nextToken(); tok.nextToken() tok.nextToken tok public int nextInt() throws IOException { return Integer.parseInt(next());} nextInt { return Integer.parseInt(next());} return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public long nextLong() throws IOException { return Long.parseLong(next());} nextLong { return Long.parseLong(next());} return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public double nextDouble() throws IOException { return Double.parseDouble(next());} nextDouble { return Double.parseDouble(next());} return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		long n = sc.nextLong();
		long result = 1;
		boolean flg = false;
		for(int i = 0; i < n; i++){
		    long a = sc.nextLong();
		    try{
		        result = multiplyExact(result, a);
		    }catch(Exception e){
		        flg = true;
		        result = 1;
		    }
		}
		if(result > 1000000000000000000L) result = -1;
		if(flg && result != 0) result = -1;
		
		// 計算
		//int result = 0;
		
		// 出力
		System.out.println(result);
	}

	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
} public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		long n = sc.nextLong();
		long result = 1;
		boolean flg = false;
		for(int i = 0; i < n; i++){
		    long a = sc.nextLong();
		    try{
		        result = multiplyExact(result, a);
		    }catch(Exception e){
		        flg = true;
		        result = 1;
		    }
		}
		if(result > 1000000000000000000L) result = -1;
		if(flg && result != 0) result = -1;
		
		// 計算
		//int result = 0;
		
		// 出力
		System.out.println(result);
	}

	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
} Main
import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		long n = sc.nextLong();
		long result = 1;
		boolean flg = false;
		for(int i = 0; i < n; i++){
		    long a = sc.nextLong();
		    try{
		        result = multiplyExact(result, a);
		    }catch(Exception e){
		        flg = true;
		        result = 1;
		    }
		}
		if(result > 1000000000000000000L) result = -1;
		if(flg && result != 0) result = -1;
		
		// 計算
		//int result = 0;
		
		// 出力
		System.out.println(result);
	}

	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
}
