import java.util.Scanner;
import java.util.ArrayList;

class Main{
      public static void main(String args[]){
	Scanner sc = new Scanner(System.in);
	long a = 1;
	double p = 0;
	int n = sc.nextInt();
	boolean zero = false;
	long m;
	ArrayList<Long> l = new ArrayList<Long>();
	for(int i=0;i<n;i++){
	    m = sc.nextLong();
	    if(m==0){
		zero = true;
	    }
	    if(zero){
		continue;
	    }
	    if(!zero){
		p+=Math.log10(m);
		l.add(m);
	    }
	}
	long x = 1;
	for(int i=0;i<18;i++){
	    x*=10;
	}
	if(!zero&&p<=18){
	    for(int i=0;i<l.size();i++){
		a*=l.get(i);
	    }
	    if(a>x){
		System.out.println("-1");
	    }else{
		System.out.println(a);
	    }
	}else if(zero){
	    System.out.println("0");
	}else{
	    System.out.println("-1");
	}
      }
} import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util class Main{
      public static void main(String args[]){
	Scanner sc = new Scanner(System.in);
	long a = 1;
	double p = 0;
	int n = sc.nextInt();
	boolean zero = false;
	long m;
	ArrayList<Long> l = new ArrayList<Long>();
	for(int i=0;i<n;i++){
	    m = sc.nextLong();
	    if(m==0){
		zero = true;
	    }
	    if(zero){
		continue;
	    }
	    if(!zero){
		p+=Math.log10(m);
		l.add(m);
	    }
	}
	long x = 1;
	for(int i=0;i<18;i++){
	    x*=10;
	}
	if(!zero&&p<=18){
	    for(int i=0;i<l.size();i++){
		a*=l.get(i);
	    }
	    if(a>x){
		System.out.println("-1");
	    }else{
		System.out.println(a);
	    }
	}else if(zero){
	    System.out.println("0");
	}else{
	    System.out.println("-1");
	}
      }
} Main public static void main(String args[]){
	Scanner sc = new Scanner(System.in);
	long a = 1;
	double p = 0;
	int n = sc.nextInt();
	boolean zero = false;
	long m;
	ArrayList<Long> l = new ArrayList<Long>();
	for(int i=0;i<n;i++){
	    m = sc.nextLong();
	    if(m==0){
		zero = true;
	    }
	    if(zero){
		continue;
	    }
	    if(!zero){
		p+=Math.log10(m);
		l.add(m);
	    }
	}
	long x = 1;
	for(int i=0;i<18;i++){
	    x*=10;
	}
	if(!zero&&p<=18){
	    for(int i=0;i<l.size();i++){
		a*=l.get(i);
	    }
	    if(a>x){
		System.out.println("-1");
	    }else{
		System.out.println(a);
	    }
	}else if(zero){
	    System.out.println("0");
	}else{
	    System.out.println("-1");
	}
      } main {
	Scanner sc = new Scanner(System.in);
	long a = 1;
	double p = 0;
	int n = sc.nextInt();
	boolean zero = false;
	long m;
	ArrayList<Long> l = new ArrayList<Long>();
	for(int i=0;i<n;i++){
	    m = sc.nextLong();
	    if(m==0){
		zero = true;
	    }
	    if(zero){
		continue;
	    }
	    if(!zero){
		p+=Math.log10(m);
		l.add(m);
	    }
	}
	long x = 1;
	for(int i=0;i<18;i++){
	    x*=10;
	}
	if(!zero&&p<=18){
	    for(int i=0;i<l.size();i++){
		a*=l.get(i);
	    }
	    if(a>x){
		System.out.println("-1");
	    }else{
		System.out.println(a);
	    }
	}else if(zero){
	    System.out.println("0");
	}else{
	    System.out.println("-1");
	}
      } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long a = 1; a 1 double p = 0; p 0 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc boolean zero = false; zero false long m; m ArrayList<Long> l = new ArrayList<Long>(); l new ArrayList<Long>() for(int i=0;i<n;i++){
	    m = sc.nextLong();
	    if(m==0){
		zero = true;
	    }
	    if(zero){
		continue;
	    }
	    if(!zero){
		p+=Math.log10(m);
		l.add(m);
	    }
	} int i=0; int i=0; i 0 i<n i n i++ i++ i {
	    m = sc.nextLong();
	    if(m==0){
		zero = true;
	    }
	    if(zero){
		continue;
	    }
	    if(!zero){
		p+=Math.log10(m);
		l.add(m);
	    }
	} {
	    m = sc.nextLong();
	    if(m==0){
		zero = true;
	    }
	    if(zero){
		continue;
	    }
	    if(!zero){
		p+=Math.log10(m);
		l.add(m);
	    }
	} m = sc.nextLong() m sc.nextLong() sc.nextLong sc if(m==0){
		zero = true;
	    } m==0 m 0 {
		zero = true;
	    } zero = true zero true if(zero){
		continue;
	    } zero {
		continue;
	    } continue; if(!zero){
		p+=Math.log10(m);
		l.add(m);
	    } !zero zero {
		p+=Math.log10(m);
		l.add(m);
	    } p+=Math.log10(m) p Math.log10(m) Math.log10 Math m l.add(m) l.add l m long x = 1; x 1 for(int i=0;i<18;i++){
	    x*=10;
	} int i=0; int i=0; i 0 i<18 i 18 i++ i++ i {
	    x*=10;
	} {
	    x*=10;
	} x*=10 x 10 if(!zero&&p<=18){
	    for(int i=0;i<l.size();i++){
		a*=l.get(i);
	    }
	    if(a>x){
		System.out.println("-1");
	    }else{
		System.out.println(a);
	    }
	}else if(zero){
	    System.out.println("0");
	}else{
	    System.out.println("-1");
	} !zero&&p<=18 !zero zero p<=18 p 18 {
	    for(int i=0;i<l.size();i++){
		a*=l.get(i);
	    }
	    if(a>x){
		System.out.println("-1");
	    }else{
		System.out.println(a);
	    }
	} for(int i=0;i<l.size();i++){
		a*=l.get(i);
	    } int i=0; int i=0; i 0 i<l.size() i l.size() l.size l i++ i++ i {
		a*=l.get(i);
	    } {
		a*=l.get(i);
	    } a*=l.get(i) a l.get(i) l.get l i if(a>x){
		System.out.println("-1");
	    }else{
		System.out.println(a);
	    } a>x a x {
		System.out.println("-1");
	    } System.out.println("-1") System.out.println System.out System System.out "-1" {
		System.out.println(a);
	    } System.out.println(a) System.out.println System.out System System.out a if(zero){
	    System.out.println("0");
	}else{
	    System.out.println("-1");
	} zero {
	    System.out.println("0");
	} System.out.println("0") System.out.println System.out System System.out "0" {
	    System.out.println("-1");
	} System.out.println("-1") System.out.println System.out System System.out "-1" String args[] args
import java.util.Scanner;
import java.util.ArrayList;

class Main{
      public static void main(String args[]){
	Scanner sc = new Scanner(System.in);
	long a = 1;
	double p = 0;
	int n = sc.nextInt();
	boolean zero = false;
	long m;
	ArrayList<Long> l = new ArrayList<Long>();
	for(int i=0;i<n;i++){
	    m = sc.nextLong();
	    if(m==0){
		zero = true;
	    }
	    if(zero){
		continue;
	    }
	    if(!zero){
		p+=Math.log10(m);
		l.add(m);
	    }
	}
	long x = 1;
	for(int i=0;i<18;i++){
	    x*=10;
	}
	if(!zero&&p<=18){
	    for(int i=0;i<l.size();i++){
		a*=l.get(i);
	    }
	    if(a>x){
		System.out.println("-1");
	    }else{
		System.out.println(a);
	    }
	}else if(zero){
	    System.out.println("0");
	}else{
	    System.out.println("-1");
	}
      }
}
