import java.io.FileNotFoundException;
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws FileNotFoundException {

//    	File file = new File("src/in.txt");

        //コード
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);

    	int N = sc.nextInt();

    	long[] A = new long[N];

    	BigInteger times = BigInteger.valueOf(1);
    	long K = (long) Math.pow(10,18);

    	boolean flg = true;
    	boolean haszero = false;

    	for(int i=0;i<N;i++) {
    		A[i]=sc.nextLong();
    	}

    	for(int i=0;i<N;i++) {
    		if(A[i]==0) {
    			haszero = true;
    			break;
    		}
    	}

    	if(haszero==false) {

        	for(int i=0;i<N;i++) {
        		times = times.multiply(BigInteger.valueOf(A[i]));

        		if(times.compareTo(BigInteger.valueOf(K))==1) {
        			flg = false;
        			break;
        		}
        	}

        	if(flg) {
        		System.out.println(times);
        	} else {
        		System.out.println("-1");
        	}

    	} else {
    		System.out.println("0");
    	}
    }
} import java.io.FileNotFoundException; FileNotFoundException java.io import java.math.BigInteger; BigInteger java.math import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws FileNotFoundException {

//    	File file = new File("src/in.txt");

        //コード
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);

    	int N = sc.nextInt();

    	long[] A = new long[N];

    	BigInteger times = BigInteger.valueOf(1);
    	long K = (long) Math.pow(10,18);

    	boolean flg = true;
    	boolean haszero = false;

    	for(int i=0;i<N;i++) {
    		A[i]=sc.nextLong();
    	}

    	for(int i=0;i<N;i++) {
    		if(A[i]==0) {
    			haszero = true;
    			break;
    		}
    	}

    	if(haszero==false) {

        	for(int i=0;i<N;i++) {
        		times = times.multiply(BigInteger.valueOf(A[i]));

        		if(times.compareTo(BigInteger.valueOf(K))==1) {
        			flg = false;
        			break;
        		}
        	}

        	if(flg) {
        		System.out.println(times);
        	} else {
        		System.out.println("-1");
        	}

    	} else {
    		System.out.println("0");
    	}
    }
} Main public static void main(String[] args) throws FileNotFoundException {

//    	File file = new File("src/in.txt");

        //コード
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);

    	int N = sc.nextInt();

    	long[] A = new long[N];

    	BigInteger times = BigInteger.valueOf(1);
    	long K = (long) Math.pow(10,18);

    	boolean flg = true;
    	boolean haszero = false;

    	for(int i=0;i<N;i++) {
    		A[i]=sc.nextLong();
    	}

    	for(int i=0;i<N;i++) {
    		if(A[i]==0) {
    			haszero = true;
    			break;
    		}
    	}

    	if(haszero==false) {

        	for(int i=0;i<N;i++) {
        		times = times.multiply(BigInteger.valueOf(A[i]));

        		if(times.compareTo(BigInteger.valueOf(K))==1) {
        			flg = false;
        			break;
        		}
        	}

        	if(flg) {
        		System.out.println(times);
        	} else {
        		System.out.println("-1");
        	}

    	} else {
    		System.out.println("0");
    	}
    } main {

//    	File file = new File("src/in.txt");

        //コード
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);

    	int N = sc.nextInt();

    	long[] A = new long[N];

    	BigInteger times = BigInteger.valueOf(1);
    	long K = (long) Math.pow(10,18);

    	boolean flg = true;
    	boolean haszero = false;

    	for(int i=0;i<N;i++) {
    		A[i]=sc.nextLong();
    	}

    	for(int i=0;i<N;i++) {
    		if(A[i]==0) {
    			haszero = true;
    			break;
    		}
    	}

    	if(haszero==false) {

        	for(int i=0;i<N;i++) {
        		times = times.multiply(BigInteger.valueOf(A[i]));

        		if(times.compareTo(BigInteger.valueOf(K))==1) {
        			flg = false;
        			break;
        		}
        	}

        	if(flg) {
        		System.out.println(times);
        	} else {
        		System.out.println("-1");
        	}

    	} else {
    		System.out.println("0");
    	}
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long[] A = new long[N]; A new long[N] N BigInteger times = BigInteger.valueOf(1); times BigInteger.valueOf(1) BigInteger.valueOf BigInteger 1 long K = (long) Math.pow(10,18); K (long) Math.pow(10,18) Math.pow Math 10 18 boolean flg = true; flg true boolean haszero = false; haszero false for(int i=0;i<N;i++) {
    		A[i]=sc.nextLong();
    	} int i=0; int i=0; i 0 i<N i N i++ i++ i {
    		A[i]=sc.nextLong();
    	} {
    		A[i]=sc.nextLong();
    	} A[i]=sc.nextLong() A[i] A i sc.nextLong() sc.nextLong sc for(int i=0;i<N;i++) {
    		if(A[i]==0) {
    			haszero = true;
    			break;
    		}
    	} int i=0; int i=0; i 0 i<N i N i++ i++ i {
    		if(A[i]==0) {
    			haszero = true;
    			break;
    		}
    	} {
    		if(A[i]==0) {
    			haszero = true;
    			break;
    		}
    	} if(A[i]==0) {
    			haszero = true;
    			break;
    		} A[i]==0 A[i] A i 0 {
    			haszero = true;
    			break;
    		} haszero = true haszero true break; if(haszero==false) {

        	for(int i=0;i<N;i++) {
        		times = times.multiply(BigInteger.valueOf(A[i]));

        		if(times.compareTo(BigInteger.valueOf(K))==1) {
        			flg = false;
        			break;
        		}
        	}

        	if(flg) {
        		System.out.println(times);
        	} else {
        		System.out.println("-1");
        	}

    	} else {
    		System.out.println("0");
    	} haszero==false haszero false {

        	for(int i=0;i<N;i++) {
        		times = times.multiply(BigInteger.valueOf(A[i]));

        		if(times.compareTo(BigInteger.valueOf(K))==1) {
        			flg = false;
        			break;
        		}
        	}

        	if(flg) {
        		System.out.println(times);
        	} else {
        		System.out.println("-1");
        	}

    	} for(int i=0;i<N;i++) {
        		times = times.multiply(BigInteger.valueOf(A[i]));

        		if(times.compareTo(BigInteger.valueOf(K))==1) {
        			flg = false;
        			break;
        		}
        	} int i=0; int i=0; i 0 i<N i N i++ i++ i {
        		times = times.multiply(BigInteger.valueOf(A[i]));

        		if(times.compareTo(BigInteger.valueOf(K))==1) {
        			flg = false;
        			break;
        		}
        	} {
        		times = times.multiply(BigInteger.valueOf(A[i]));

        		if(times.compareTo(BigInteger.valueOf(K))==1) {
        			flg = false;
        			break;
        		}
        	} times = times.multiply(BigInteger.valueOf(A[i])) times times.multiply(BigInteger.valueOf(A[i])) times.multiply times BigInteger.valueOf(A[i]) BigInteger.valueOf BigInteger A[i] A i if(times.compareTo(BigInteger.valueOf(K))==1) {
        			flg = false;
        			break;
        		} times.compareTo(BigInteger.valueOf(K))==1 times.compareTo(BigInteger.valueOf(K)) times.compareTo times BigInteger.valueOf(K) BigInteger.valueOf BigInteger K 1 {
        			flg = false;
        			break;
        		} flg = false flg false break; if(flg) {
        		System.out.println(times);
        	} else {
        		System.out.println("-1");
        	} flg {
        		System.out.println(times);
        	} System.out.println(times) System.out.println System.out System System.out times {
        		System.out.println("-1");
        	} System.out.println("-1") System.out.println System.out System System.out "-1" {
    		System.out.println("0");
    	} System.out.println("0") System.out.println System.out System System.out "0" String[] args args public class Main {
    public static void main(String[] args) throws FileNotFoundException {

//    	File file = new File("src/in.txt");

        //コード
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);

    	int N = sc.nextInt();

    	long[] A = new long[N];

    	BigInteger times = BigInteger.valueOf(1);
    	long K = (long) Math.pow(10,18);

    	boolean flg = true;
    	boolean haszero = false;

    	for(int i=0;i<N;i++) {
    		A[i]=sc.nextLong();
    	}

    	for(int i=0;i<N;i++) {
    		if(A[i]==0) {
    			haszero = true;
    			break;
    		}
    	}

    	if(haszero==false) {

        	for(int i=0;i<N;i++) {
        		times = times.multiply(BigInteger.valueOf(A[i]));

        		if(times.compareTo(BigInteger.valueOf(K))==1) {
        			flg = false;
        			break;
        		}
        	}

        	if(flg) {
        		System.out.println(times);
        	} else {
        		System.out.println("-1");
        	}

    	} else {
    		System.out.println("0");
    	}
    }
} public class Main {
    public static void main(String[] args) throws FileNotFoundException {

//    	File file = new File("src/in.txt");

        //コード
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);

    	int N = sc.nextInt();

    	long[] A = new long[N];

    	BigInteger times = BigInteger.valueOf(1);
    	long K = (long) Math.pow(10,18);

    	boolean flg = true;
    	boolean haszero = false;

    	for(int i=0;i<N;i++) {
    		A[i]=sc.nextLong();
    	}

    	for(int i=0;i<N;i++) {
    		if(A[i]==0) {
    			haszero = true;
    			break;
    		}
    	}

    	if(haszero==false) {

        	for(int i=0;i<N;i++) {
        		times = times.multiply(BigInteger.valueOf(A[i]));

        		if(times.compareTo(BigInteger.valueOf(K))==1) {
        			flg = false;
        			break;
        		}
        	}

        	if(flg) {
        		System.out.println(times);
        	} else {
        		System.out.println("-1");
        	}

    	} else {
    		System.out.println("0");
    	}
    }
} Main
import java.io.FileNotFoundException;
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws FileNotFoundException {

//    	File file = new File("src/in.txt");

        //コード
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);

    	int N = sc.nextInt();

    	long[] A = new long[N];

    	BigInteger times = BigInteger.valueOf(1);
    	long K = (long) Math.pow(10,18);

    	boolean flg = true;
    	boolean haszero = false;

    	for(int i=0;i<N;i++) {
    		A[i]=sc.nextLong();
    	}

    	for(int i=0;i<N;i++) {
    		if(A[i]==0) {
    			haszero = true;
    			break;
    		}
    	}

    	if(haszero==false) {

        	for(int i=0;i<N;i++) {
        		times = times.multiply(BigInteger.valueOf(A[i]));

        		if(times.compareTo(BigInteger.valueOf(K))==1) {
        			flg = false;
        			break;
        		}
        	}

        	if(flg) {
        		System.out.println(times);
        	} else {
        		System.out.println("-1");
        	}

    	} else {
    		System.out.println("0");
    	}
    }
}