//--- pB ---//
import java.util.*;
import java.lang.*;
import java.io.*;
public class Main {
	public static void main (String[] args) throws java.lang.Exception {
		new Solution();
	}
}
class Solution {
	Reader reader;
	PrintWriter out;
	public Solution() {
		reader = new Reader();
		out = new PrintWriter(System.out);
		while (reader.hasNext()) {
			run_case();
		}
		out.flush();
	}

	private void run_case() {
		int n = reader.ni();
		long[] arr = new long[n];
		for (int i=0; i<n; i++) arr[i] = reader.nl();
		// Arrays.sort(arr);

		for (int i=0; i<n; i++) {
			if (arr[i] == 0) {
				out.println("0");
				return;
			}
		}

		long res = 1;
		long inf = (long)1e18;
		for (int i=0; i<n; i++) {
			long bound = inf / res;
			if (arr[i] > bound) {
				out.println("-1");
				return;
			}
			res *= arr[i];
		}

		out.println(res);
		return;
	}
}


class Reader {
	BufferedReader br;
	StringTokenizer st;
	public Reader(){
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	public String next() {
		if (st.hasMoreTokens()) return st.nextToken();
		try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return st.nextToken();
	}
	public boolean hasNext() {
		try {
			if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}
	public int ni() {return Integer.parseInt(this.next());}
	public long nl() {return Long.parseLong(this.next());}
	public String ns() {return this.next();}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main {
	public static void main (String[] args) throws java.lang.Exception {
		new Solution();
	}
} Main public static void main (String[] args) throws java.lang.Exception {
		new Solution();
	} main {
		new Solution();
	} new Solution() String[] args args class Solution {
	Reader reader;
	PrintWriter out;
	public Solution() {
		reader = new Reader();
		out = new PrintWriter(System.out);
		while (reader.hasNext()) {
			run_case();
		}
		out.flush();
	}

	private void run_case() {
		int n = reader.ni();
		long[] arr = new long[n];
		for (int i=0; i<n; i++) arr[i] = reader.nl();
		// Arrays.sort(arr);

		for (int i=0; i<n; i++) {
			if (arr[i] == 0) {
				out.println("0");
				return;
			}
		}

		long res = 1;
		long inf = (long)1e18;
		for (int i=0; i<n; i++) {
			long bound = inf / res;
			if (arr[i] > bound) {
				out.println("-1");
				return;
			}
			res *= arr[i];
		}

		out.println(res);
		return;
	}
} Solution Reader reader; reader PrintWriter out; out public Solution() {
		reader = new Reader();
		out = new PrintWriter(System.out);
		while (reader.hasNext()) {
			run_case();
		}
		out.flush();
	} Solution {
		reader = new Reader();
		out = new PrintWriter(System.out);
		while (reader.hasNext()) {
			run_case();
		}
		out.flush();
	} reader = new Reader() reader new Reader() out = new PrintWriter(System.out) out new PrintWriter(System.out) while (reader.hasNext()) {
			run_case();
		} reader.hasNext() reader.hasNext reader {
			run_case();
		} run_case() run_case out.flush() out.flush out private void run_case() {
		int n = reader.ni();
		long[] arr = new long[n];
		for (int i=0; i<n; i++) arr[i] = reader.nl();
		// Arrays.sort(arr);

		for (int i=0; i<n; i++) {
			if (arr[i] == 0) {
				out.println("0");
				return;
			}
		}

		long res = 1;
		long inf = (long)1e18;
		for (int i=0; i<n; i++) {
			long bound = inf / res;
			if (arr[i] > bound) {
				out.println("-1");
				return;
			}
			res *= arr[i];
		}

		out.println(res);
		return;
	} run_case {
		int n = reader.ni();
		long[] arr = new long[n];
		for (int i=0; i<n; i++) arr[i] = reader.nl();
		// Arrays.sort(arr);

		for (int i=0; i<n; i++) {
			if (arr[i] == 0) {
				out.println("0");
				return;
			}
		}

		long res = 1;
		long inf = (long)1e18;
		for (int i=0; i<n; i++) {
			long bound = inf / res;
			if (arr[i] > bound) {
				out.println("-1");
				return;
			}
			res *= arr[i];
		}

		out.println(res);
		return;
	} int n = reader.ni(); n reader.ni() reader.ni reader long[] arr = new long[n]; arr new long[n] n for (int i=0; i<n; i++) arr[i] = reader.nl(); int i=0; int i=0; i 0 i<n i n i++ i++ i arr[i] = reader.nl(); arr[i] = reader.nl() arr[i] arr i reader.nl() reader.nl reader for (int i=0; i<n; i++) {
			if (arr[i] == 0) {
				out.println("0");
				return;
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			if (arr[i] == 0) {
				out.println("0");
				return;
			}
		} {
			if (arr[i] == 0) {
				out.println("0");
				return;
			}
		} if (arr[i] == 0) {
				out.println("0");
				return;
			} arr[i] == 0 arr[i] arr i 0 {
				out.println("0");
				return;
			} out.println("0") out.println out "0" return; long res = 1; res 1 long inf = (long)1e18; inf (long)1e18 for (int i=0; i<n; i++) {
			long bound = inf / res;
			if (arr[i] > bound) {
				out.println("-1");
				return;
			}
			res *= arr[i];
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			long bound = inf / res;
			if (arr[i] > bound) {
				out.println("-1");
				return;
			}
			res *= arr[i];
		} {
			long bound = inf / res;
			if (arr[i] > bound) {
				out.println("-1");
				return;
			}
			res *= arr[i];
		} long bound = inf / res; bound inf / res inf res if (arr[i] > bound) {
				out.println("-1");
				return;
			} arr[i] > bound arr[i] arr i bound {
				out.println("-1");
				return;
			} out.println("-1") out.println out "-1" return; res *= arr[i] res arr[i] arr i out.println(res) out.println out res return; class Reader {
	BufferedReader br;
	StringTokenizer st;
	public Reader(){
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	public String next() {
		if (st.hasMoreTokens()) return st.nextToken();
		try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return st.nextToken();
	}
	public boolean hasNext() {
		try {
			if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}
	public int ni() {return Integer.parseInt(this.next());}
	public long nl() {return Long.parseLong(this.next());}
	public String ns() {return this.next();}
} Reader BufferedReader br; br StringTokenizer st; st public Reader(){
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
	} Reader {
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
	} try {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer(br.readLine());
		} br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) public String next() {
		if (st.hasMoreTokens()) return st.nextToken();
		try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return st.nextToken();
	} next {
		if (st.hasMoreTokens()) return st.nextToken();
		try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return st.nextToken();
	} if (st.hasMoreTokens()) return st.nextToken(); st.hasMoreTokens() st.hasMoreTokens st return st.nextToken(); st.nextToken() st.nextToken st try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			st = new StringTokenizer(br.readLine());
		} st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st public boolean hasNext() {
		try {
			if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	} hasNext {
		try {
			if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	} try {
			if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true;
		} catch (Exception e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true;
		} if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true; !st.hasMoreTokens() && !br.ready() !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st !br.ready() br.ready() br.ready br return false; false return true; true return false; false public int ni() {return Integer.parseInt(this.next());} ni {return Integer.parseInt(this.next());} return Integer.parseInt(this.next()); Integer.parseInt(this.next()) Integer.parseInt Integer this.next() this.next this public long nl() {return Long.parseLong(this.next());} nl {return Long.parseLong(this.next());} return Long.parseLong(this.next()); Long.parseLong(this.next()) Long.parseLong Long this.next() this.next this public String ns() {return this.next();} ns {return this.next();} return this.next(); this.next() this.next this public class Main {
	public static void main (String[] args) throws java.lang.Exception {
		new Solution();
	}
} public class Main {
	public static void main (String[] args) throws java.lang.Exception {
		new Solution();
	}
} Main
//--- pB ---//
import java.util.*;
import java.lang.*;
import java.io.*;
public class Main {
	public static void main (String[] args) throws java.lang.Exception {
		new Solution();
	}
}
class Solution {
	Reader reader;
	PrintWriter out;
	public Solution() {
		reader = new Reader();
		out = new PrintWriter(System.out);
		while (reader.hasNext()) {
			run_case();
		}
		out.flush();
	}

	private void run_case() {
		int n = reader.ni();
		long[] arr = new long[n];
		for (int i=0; i<n; i++) arr[i] = reader.nl();
		// Arrays.sort(arr);

		for (int i=0; i<n; i++) {
			if (arr[i] == 0) {
				out.println("0");
				return;
			}
		}

		long res = 1;
		long inf = (long)1e18;
		for (int i=0; i<n; i++) {
			long bound = inf / res;
			if (arr[i] > bound) {
				out.println("-1");
				return;
			}
			res *= arr[i];
		}

		out.println(res);
		return;
	}
}


class Reader {
	BufferedReader br;
	StringTokenizer st;
	public Reader(){
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	public String next() {
		if (st.hasMoreTokens()) return st.nextToken();
		try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return st.nextToken();
	}
	public boolean hasNext() {
		try {
			if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}
	public int ni() {return Integer.parseInt(this.next());}
	public long nl() {return Long.parseLong(this.next());}
	public String ns() {return this.next();}
}
