import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long ans = 1;
		int check = 0;
		long[] a = new long[n];
		for(int i = 0; i < a.length; ++i){
          a[i] = sc.nextLong();
          if(a[i]==0){
              check = 1;
          }
        }
        int[] b = new int[18];
        for(int j=0; j<18; ++j){
            b[j] = 10;
        }
        long num = 1;
        for(int j=0; j<18; ++j){
            num = num*b[j];
        }
         for(int i=0; i<n; ++i){
           if(a[i]<=num/ans){
            ans = ans*a[i];
           }else{
             ans=0;
          	break;
           }
         }
         if(check == 0){
             if(ans == 0){
             System.out.println("-1");
            }else{
              System.out.println(ans);
            }
         }else{
             System.out.println("0");
         }
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long ans = 1;
		int check = 0;
		long[] a = new long[n];
		for(int i = 0; i < a.length; ++i){
          a[i] = sc.nextLong();
          if(a[i]==0){
              check = 1;
          }
        }
        int[] b = new int[18];
        for(int j=0; j<18; ++j){
            b[j] = 10;
        }
        long num = 1;
        for(int j=0; j<18; ++j){
            num = num*b[j];
        }
         for(int i=0; i<n; ++i){
           if(a[i]<=num/ans){
            ans = ans*a[i];
           }else{
             ans=0;
          	break;
           }
         }
         if(check == 0){
             if(ans == 0){
             System.out.println("-1");
            }else{
              System.out.println(ans);
            }
         }else{
             System.out.println("0");
         }
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long ans = 1;
		int check = 0;
		long[] a = new long[n];
		for(int i = 0; i < a.length; ++i){
          a[i] = sc.nextLong();
          if(a[i]==0){
              check = 1;
          }
        }
        int[] b = new int[18];
        for(int j=0; j<18; ++j){
            b[j] = 10;
        }
        long num = 1;
        for(int j=0; j<18; ++j){
            num = num*b[j];
        }
         for(int i=0; i<n; ++i){
           if(a[i]<=num/ans){
            ans = ans*a[i];
           }else{
             ans=0;
          	break;
           }
         }
         if(check == 0){
             if(ans == 0){
             System.out.println("-1");
            }else{
              System.out.println(ans);
            }
         }else{
             System.out.println("0");
         }
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long ans = 1;
		int check = 0;
		long[] a = new long[n];
		for(int i = 0; i < a.length; ++i){
          a[i] = sc.nextLong();
          if(a[i]==0){
              check = 1;
          }
        }
        int[] b = new int[18];
        for(int j=0; j<18; ++j){
            b[j] = 10;
        }
        long num = 1;
        for(int j=0; j<18; ++j){
            num = num*b[j];
        }
         for(int i=0; i<n; ++i){
           if(a[i]<=num/ans){
            ans = ans*a[i];
           }else{
             ans=0;
          	break;
           }
         }
         if(check == 0){
             if(ans == 0){
             System.out.println("-1");
            }else{
              System.out.println(ans);
            }
         }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 ans = 1; ans 1 int check = 0; check 0 long[] a = new long[n]; a new long[n] n for(int i = 0; i < a.length; ++i){
          a[i] = sc.nextLong();
          if(a[i]==0){
              check = 1;
          }
        } int i = 0; int i = 0; i 0 i < a.length i a.length a a.length ++i ++i i {
          a[i] = sc.nextLong();
          if(a[i]==0){
              check = 1;
          }
        } {
          a[i] = sc.nextLong();
          if(a[i]==0){
              check = 1;
          }
        } a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc if(a[i]==0){
              check = 1;
          } a[i]==0 a[i] a i 0 {
              check = 1;
          } check = 1 check 1 int[] b = new int[18]; b new int[18] 18 for(int j=0; j<18; ++j){
            b[j] = 10;
        } int j=0; int j=0; j 0 j<18 j 18 ++j ++j j {
            b[j] = 10;
        } {
            b[j] = 10;
        } b[j] = 10 b[j] b j 10 long num = 1; num 1 for(int j=0; j<18; ++j){
            num = num*b[j];
        } int j=0; int j=0; j 0 j<18 j 18 ++j ++j j {
            num = num*b[j];
        } {
            num = num*b[j];
        } num = num*b[j] num num*b[j] num b[j] b j for(int i=0; i<n; ++i){
           if(a[i]<=num/ans){
            ans = ans*a[i];
           }else{
             ans=0;
          	break;
           }
         } int i=0; int i=0; i 0 i<n i n ++i ++i i {
           if(a[i]<=num/ans){
            ans = ans*a[i];
           }else{
             ans=0;
          	break;
           }
         } {
           if(a[i]<=num/ans){
            ans = ans*a[i];
           }else{
             ans=0;
          	break;
           }
         } if(a[i]<=num/ans){
            ans = ans*a[i];
           }else{
             ans=0;
          	break;
           } a[i]<=num/ans a[i] a i num/ans num ans {
            ans = ans*a[i];
           } ans = ans*a[i] ans ans*a[i] ans a[i] a i {
             ans=0;
          	break;
           } ans=0 ans 0 break; if(check == 0){
             if(ans == 0){
             System.out.println("-1");
            }else{
              System.out.println(ans);
            }
         }else{
             System.out.println("0");
         } check == 0 check 0 {
             if(ans == 0){
             System.out.println("-1");
            }else{
              System.out.println(ans);
            }
         } if(ans == 0){
             System.out.println("-1");
            }else{
              System.out.println(ans);
            } ans == 0 ans 0 {
             System.out.println("-1");
            } System.out.println("-1") System.out.println System.out System System.out "-1" {
              System.out.println(ans);
            } System.out.println(ans) System.out.println System.out System System.out ans {
             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){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long ans = 1;
		int check = 0;
		long[] a = new long[n];
		for(int i = 0; i < a.length; ++i){
          a[i] = sc.nextLong();
          if(a[i]==0){
              check = 1;
          }
        }
        int[] b = new int[18];
        for(int j=0; j<18; ++j){
            b[j] = 10;
        }
        long num = 1;
        for(int j=0; j<18; ++j){
            num = num*b[j];
        }
         for(int i=0; i<n; ++i){
           if(a[i]<=num/ans){
            ans = ans*a[i];
           }else{
             ans=0;
          	break;
           }
         }
         if(check == 0){
             if(ans == 0){
             System.out.println("-1");
            }else{
              System.out.println(ans);
            }
         }else{
             System.out.println("0");
         }
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long ans = 1;
		int check = 0;
		long[] a = new long[n];
		for(int i = 0; i < a.length; ++i){
          a[i] = sc.nextLong();
          if(a[i]==0){
              check = 1;
          }
        }
        int[] b = new int[18];
        for(int j=0; j<18; ++j){
            b[j] = 10;
        }
        long num = 1;
        for(int j=0; j<18; ++j){
            num = num*b[j];
        }
         for(int i=0; i<n; ++i){
           if(a[i]<=num/ans){
            ans = ans*a[i];
           }else{
             ans=0;
          	break;
           }
         }
         if(check == 0){
             if(ans == 0){
             System.out.println("-1");
            }else{
              System.out.println(ans);
            }
         }else{
             System.out.println("0");
         }
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long ans = 1;
		int check = 0;
		long[] a = new long[n];
		for(int i = 0; i < a.length; ++i){
          a[i] = sc.nextLong();
          if(a[i]==0){
              check = 1;
          }
        }
        int[] b = new int[18];
        for(int j=0; j<18; ++j){
            b[j] = 10;
        }
        long num = 1;
        for(int j=0; j<18; ++j){
            num = num*b[j];
        }
         for(int i=0; i<n; ++i){
           if(a[i]<=num/ans){
            ans = ans*a[i];
           }else{
             ans=0;
          	break;
           }
         }
         if(check == 0){
             if(ans == 0){
             System.out.println("-1");
            }else{
              System.out.println(ans);
            }
         }else{
             System.out.println("0");
         }
	}
}
