import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		
		int n = Integer.parseInt(br.readLine());
		long res = 1;
		long[] a = new long[n];
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i=0; i<n; i++) {
			a[i] = Long.parseLong(st.nextToken());
			if(a[i] == 0)
				res = 0;
		}
		
		if(res != 0) {
			for(int i=0; i<n; i++) {
				if(a[i] <= (long)Math.pow(10, 18)/res)
					res *= a[i];
				else {
					res = -1;
					break;
				}
			}
		}
		bw.write(res + "\n");
		bw.flush();
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.BufferedWriter; BufferedWriter java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.OutputStreamWriter; OutputStreamWriter java.io import java.util.StringTokenizer; StringTokenizer java.util public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		
		int n = Integer.parseInt(br.readLine());
		long res = 1;
		long[] a = new long[n];
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i=0; i<n; i++) {
			a[i] = Long.parseLong(st.nextToken());
			if(a[i] == 0)
				res = 0;
		}
		
		if(res != 0) {
			for(int i=0; i<n; i++) {
				if(a[i] <= (long)Math.pow(10, 18)/res)
					res *= a[i];
				else {
					res = -1;
					break;
				}
			}
		}
		bw.write(res + "\n");
		bw.flush();
	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		
		int n = Integer.parseInt(br.readLine());
		long res = 1;
		long[] a = new long[n];
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i=0; i<n; i++) {
			a[i] = Long.parseLong(st.nextToken());
			if(a[i] == 0)
				res = 0;
		}
		
		if(res != 0) {
			for(int i=0; i<n; i++) {
				if(a[i] <= (long)Math.pow(10, 18)/res)
					res *= a[i];
				else {
					res = -1;
					break;
				}
			}
		}
		bw.write(res + "\n");
		bw.flush();
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		
		int n = Integer.parseInt(br.readLine());
		long res = 1;
		long[] a = new long[n];
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i=0; i<n; i++) {
			a[i] = Long.parseLong(st.nextToken());
			if(a[i] == 0)
				res = 0;
		}
		
		if(res != 0) {
			for(int i=0; i<n; i++) {
				if(a[i] <= (long)Math.pow(10, 18)/res)
					res *= a[i];
				else {
					res = -1;
					break;
				}
			}
		}
		bw.write(res + "\n");
		bw.flush();
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); bw new BufferedWriter(new OutputStreamWriter(System.out)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br long res = 1; res 1 long[] a = new long[n]; a new long[n] n StringTokenizer st = new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) for(int i=0; i<n; i++) {
			a[i] = Long.parseLong(st.nextToken());
			if(a[i] == 0)
				res = 0;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			a[i] = Long.parseLong(st.nextToken());
			if(a[i] == 0)
				res = 0;
		} {
			a[i] = Long.parseLong(st.nextToken());
			if(a[i] == 0)
				res = 0;
		} a[i] = Long.parseLong(st.nextToken()) a[i] a i Long.parseLong(st.nextToken()) Long.parseLong Long st.nextToken() st.nextToken st if(a[i] == 0)
				res = 0; a[i] == 0 a[i] a i 0 res = 0 res 0 if(res != 0) {
			for(int i=0; i<n; i++) {
				if(a[i] <= (long)Math.pow(10, 18)/res)
					res *= a[i];
				else {
					res = -1;
					break;
				}
			}
		} res != 0 res 0 {
			for(int i=0; i<n; i++) {
				if(a[i] <= (long)Math.pow(10, 18)/res)
					res *= a[i];
				else {
					res = -1;
					break;
				}
			}
		} for(int i=0; i<n; i++) {
				if(a[i] <= (long)Math.pow(10, 18)/res)
					res *= a[i];
				else {
					res = -1;
					break;
				}
			} int i=0; int i=0; i 0 i<n i n i++ i++ i {
				if(a[i] <= (long)Math.pow(10, 18)/res)
					res *= a[i];
				else {
					res = -1;
					break;
				}
			} {
				if(a[i] <= (long)Math.pow(10, 18)/res)
					res *= a[i];
				else {
					res = -1;
					break;
				}
			} if(a[i] <= (long)Math.pow(10, 18)/res)
					res *= a[i];
				else {
					res = -1;
					break;
				} a[i] <= (long)Math.pow(10, 18)/res a[i] a i (long)Math.pow(10, 18)/res (long)Math.pow(10, 18) Math.pow Math 10 18 res res *= a[i] res a[i] a i {
					res = -1;
					break;
				} res = -1 res -1 1 break; bw.write(res + "\n") bw.write bw res + "\n" res "\n" bw.flush() bw.flush bw String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		
		int n = Integer.parseInt(br.readLine());
		long res = 1;
		long[] a = new long[n];
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i=0; i<n; i++) {
			a[i] = Long.parseLong(st.nextToken());
			if(a[i] == 0)
				res = 0;
		}
		
		if(res != 0) {
			for(int i=0; i<n; i++) {
				if(a[i] <= (long)Math.pow(10, 18)/res)
					res *= a[i];
				else {
					res = -1;
					break;
				}
			}
		}
		bw.write(res + "\n");
		bw.flush();
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		
		int n = Integer.parseInt(br.readLine());
		long res = 1;
		long[] a = new long[n];
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i=0; i<n; i++) {
			a[i] = Long.parseLong(st.nextToken());
			if(a[i] == 0)
				res = 0;
		}
		
		if(res != 0) {
			for(int i=0; i<n; i++) {
				if(a[i] <= (long)Math.pow(10, 18)/res)
					res *= a[i];
				else {
					res = -1;
					break;
				}
			}
		}
		bw.write(res + "\n");
		bw.flush();
	}

} Main
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		
		int n = Integer.parseInt(br.readLine());
		long res = 1;
		long[] a = new long[n];
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i=0; i<n; i++) {
			a[i] = Long.parseLong(st.nextToken());
			if(a[i] == 0)
				res = 0;
		}
		
		if(res != 0) {
			for(int i=0; i<n; i++) {
				if(a[i] <= (long)Math.pow(10, 18)/res)
					res *= a[i];
				else {
					res = -1;
					break;
				}
			}
		}
		bw.write(res + "\n");
		bw.flush();
	}

}
