
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		ArrayList<Long> a = new ArrayList<>();
		for(int i=0; i<n; i++) {
			long v = sc.nextLong();
			if(v==0) {
				System.out.println(0);
				sc.close();
				return;
			}
			a.add(v);
		}
		long ans = 1;
		long MAX = (long)1e18;
		for(int i=0; i<n; i++) {
			long v = a.get(i);
			if(ans > MAX/v) {
				System.out.println(-1);
				sc.close();
				return;
			}
			ans *= v;
		}
		System.out.println(ans);
		sc.close();
	}


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

	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		ArrayList<Long> a = new ArrayList<>();
		for(int i=0; i<n; i++) {
			long v = sc.nextLong();
			if(v==0) {
				System.out.println(0);
				sc.close();
				return;
			}
			a.add(v);
		}
		long ans = 1;
		long MAX = (long)1e18;
		for(int i=0; i<n; i++) {
			long v = a.get(i);
			if(ans > MAX/v) {
				System.out.println(-1);
				sc.close();
				return;
			}
			ans *= v;
		}
		System.out.println(ans);
		sc.close();
	}


} Main public static void main(String[] args) {
		Main main = new Main();
		main.run();
	} main {
		Main main = new Main();
		main.run();
	} Main main = new Main(); main new Main() main.run() main.run main String[] args args public void run() {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		ArrayList<Long> a = new ArrayList<>();
		for(int i=0; i<n; i++) {
			long v = sc.nextLong();
			if(v==0) {
				System.out.println(0);
				sc.close();
				return;
			}
			a.add(v);
		}
		long ans = 1;
		long MAX = (long)1e18;
		for(int i=0; i<n; i++) {
			long v = a.get(i);
			if(ans > MAX/v) {
				System.out.println(-1);
				sc.close();
				return;
			}
			ans *= v;
		}
		System.out.println(ans);
		sc.close();
	} run {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		ArrayList<Long> a = new ArrayList<>();
		for(int i=0; i<n; i++) {
			long v = sc.nextLong();
			if(v==0) {
				System.out.println(0);
				sc.close();
				return;
			}
			a.add(v);
		}
		long ans = 1;
		long MAX = (long)1e18;
		for(int i=0; i<n; i++) {
			long v = a.get(i);
			if(ans > MAX/v) {
				System.out.println(-1);
				sc.close();
				return;
			}
			ans *= v;
		}
		System.out.println(ans);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc ArrayList<Long> a = new ArrayList<>(); a new ArrayList<>() for(int i=0; i<n; i++) {
			long v = sc.nextLong();
			if(v==0) {
				System.out.println(0);
				sc.close();
				return;
			}
			a.add(v);
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			long v = sc.nextLong();
			if(v==0) {
				System.out.println(0);
				sc.close();
				return;
			}
			a.add(v);
		} {
			long v = sc.nextLong();
			if(v==0) {
				System.out.println(0);
				sc.close();
				return;
			}
			a.add(v);
		} long v = sc.nextLong(); v sc.nextLong() sc.nextLong sc if(v==0) {
				System.out.println(0);
				sc.close();
				return;
			} v==0 v 0 {
				System.out.println(0);
				sc.close();
				return;
			} System.out.println(0) System.out.println System.out System System.out 0 sc.close() sc.close sc return; a.add(v) a.add a v long ans = 1; ans 1 long MAX = (long)1e18; MAX (long)1e18 for(int i=0; i<n; i++) {
			long v = a.get(i);
			if(ans > MAX/v) {
				System.out.println(-1);
				sc.close();
				return;
			}
			ans *= v;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			long v = a.get(i);
			if(ans > MAX/v) {
				System.out.println(-1);
				sc.close();
				return;
			}
			ans *= v;
		} {
			long v = a.get(i);
			if(ans > MAX/v) {
				System.out.println(-1);
				sc.close();
				return;
			}
			ans *= v;
		} long v = a.get(i); v a.get(i) a.get a i if(ans > MAX/v) {
				System.out.println(-1);
				sc.close();
				return;
			} ans > MAX/v ans MAX/v MAX v {
				System.out.println(-1);
				sc.close();
				return;
			} System.out.println(-1) System.out.println System.out System System.out -1 1 sc.close() sc.close sc return; ans *= v ans v System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc public class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		ArrayList<Long> a = new ArrayList<>();
		for(int i=0; i<n; i++) {
			long v = sc.nextLong();
			if(v==0) {
				System.out.println(0);
				sc.close();
				return;
			}
			a.add(v);
		}
		long ans = 1;
		long MAX = (long)1e18;
		for(int i=0; i<n; i++) {
			long v = a.get(i);
			if(ans > MAX/v) {
				System.out.println(-1);
				sc.close();
				return;
			}
			ans *= v;
		}
		System.out.println(ans);
		sc.close();
	}


} public class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		ArrayList<Long> a = new ArrayList<>();
		for(int i=0; i<n; i++) {
			long v = sc.nextLong();
			if(v==0) {
				System.out.println(0);
				sc.close();
				return;
			}
			a.add(v);
		}
		long ans = 1;
		long MAX = (long)1e18;
		for(int i=0; i<n; i++) {
			long v = a.get(i);
			if(ans > MAX/v) {
				System.out.println(-1);
				sc.close();
				return;
			}
			ans *= v;
		}
		System.out.println(ans);
		sc.close();
	}


} Main

import java.util.*;

public class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		ArrayList<Long> a = new ArrayList<>();
		for(int i=0; i<n; i++) {
			long v = sc.nextLong();
			if(v==0) {
				System.out.println(0);
				sc.close();
				return;
			}
			a.add(v);
		}
		long ans = 1;
		long MAX = (long)1e18;
		for(int i=0; i<n; i++) {
			long v = a.get(i);
			if(ans > MAX/v) {
				System.out.println(-1);
				sc.close();
				return;
			}
			ans *= v;
		}
		System.out.println(ans);
		sc.close();
	}


}