import java.io.*;
import java.math.*;
import java.util.*;



public class Main {

    static MyScanner ob = new MyScanner();
    static   PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
    static int N ;
    static int [] A;
     static char[][] arr = new char[100][1000];
    public static void main(String args[]) throws IOException {
       int N = ob.nextInt();
       long [] arr = new long[N];
       boolean zero = false;
       for(int i=0;i<N;i++){
           arr[i] = ob.nextLong();
           if(arr[i]==0){
               zero = true;
           }
       }
       long max = 10;
       for(int i=0;i<17;i++){
           max*=10;
       }
       if(zero){
           pw.println(0);
       }else{
           boolean overflow = false;
           long prod = 1;
        for(int i=0;i<N;i++){
            if(arr[i]<=max/prod){
                prod*=arr[i];
            }else{
                overflow = true;
            }
        }
        pw.println(overflow?"-1":prod);
       }    
    
        pw.flush();
    }


    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
} import java.io.*; io.* java import java.math.*; math.* java import java.util.*; util.* java public class Main {

    static MyScanner ob = new MyScanner();
    static   PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
    static int N ;
    static int [] A;
     static char[][] arr = new char[100][1000];
    public static void main(String args[]) throws IOException {
       int N = ob.nextInt();
       long [] arr = new long[N];
       boolean zero = false;
       for(int i=0;i<N;i++){
           arr[i] = ob.nextLong();
           if(arr[i]==0){
               zero = true;
           }
       }
       long max = 10;
       for(int i=0;i<17;i++){
           max*=10;
       }
       if(zero){
           pw.println(0);
       }else{
           boolean overflow = false;
           long prod = 1;
        for(int i=0;i<N;i++){
            if(arr[i]<=max/prod){
                prod*=arr[i];
            }else{
                overflow = true;
            }
        }
        pw.println(overflow?"-1":prod);
       }    
    
        pw.flush();
    }


    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
} Main static MyScanner ob = new MyScanner(); ob new MyScanner() static   PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out)); pw new PrintWriter(new OutputStreamWriter(System.out)) static int N ; N static int [] A; A static char[][] arr = new char[100][1000]; arr new char[100][1000] 100 1000 public static void main(String args[]) throws IOException {
       int N = ob.nextInt();
       long [] arr = new long[N];
       boolean zero = false;
       for(int i=0;i<N;i++){
           arr[i] = ob.nextLong();
           if(arr[i]==0){
               zero = true;
           }
       }
       long max = 10;
       for(int i=0;i<17;i++){
           max*=10;
       }
       if(zero){
           pw.println(0);
       }else{
           boolean overflow = false;
           long prod = 1;
        for(int i=0;i<N;i++){
            if(arr[i]<=max/prod){
                prod*=arr[i];
            }else{
                overflow = true;
            }
        }
        pw.println(overflow?"-1":prod);
       }    
    
        pw.flush();
    } main {
       int N = ob.nextInt();
       long [] arr = new long[N];
       boolean zero = false;
       for(int i=0;i<N;i++){
           arr[i] = ob.nextLong();
           if(arr[i]==0){
               zero = true;
           }
       }
       long max = 10;
       for(int i=0;i<17;i++){
           max*=10;
       }
       if(zero){
           pw.println(0);
       }else{
           boolean overflow = false;
           long prod = 1;
        for(int i=0;i<N;i++){
            if(arr[i]<=max/prod){
                prod*=arr[i];
            }else{
                overflow = true;
            }
        }
        pw.println(overflow?"-1":prod);
       }    
    
        pw.flush();
    } int N = ob.nextInt(); N ob.nextInt() ob.nextInt ob long [] arr = new long[N]; arr new long[N] N boolean zero = false; zero false for(int i=0;i<N;i++){
           arr[i] = ob.nextLong();
           if(arr[i]==0){
               zero = true;
           }
       } int i=0; int i=0; i 0 i<N i N i++ i++ i {
           arr[i] = ob.nextLong();
           if(arr[i]==0){
               zero = true;
           }
       } {
           arr[i] = ob.nextLong();
           if(arr[i]==0){
               zero = true;
           }
       } arr[i] = ob.nextLong() arr[i] arr i ob.nextLong() ob.nextLong ob if(arr[i]==0){
               zero = true;
           } arr[i]==0 arr[i] arr i 0 {
               zero = true;
           } zero = true zero true long max = 10; max 10 for(int i=0;i<17;i++){
           max*=10;
       } int i=0; int i=0; i 0 i<17 i 17 i++ i++ i {
           max*=10;
       } {
           max*=10;
       } max*=10 max 10 if(zero){
           pw.println(0);
       }else{
           boolean overflow = false;
           long prod = 1;
        for(int i=0;i<N;i++){
            if(arr[i]<=max/prod){
                prod*=arr[i];
            }else{
                overflow = true;
            }
        }
        pw.println(overflow?"-1":prod);
       } zero {
           pw.println(0);
       } pw.println(0) pw.println pw 0 {
           boolean overflow = false;
           long prod = 1;
        for(int i=0;i<N;i++){
            if(arr[i]<=max/prod){
                prod*=arr[i];
            }else{
                overflow = true;
            }
        }
        pw.println(overflow?"-1":prod);
       } boolean overflow = false; overflow false long prod = 1; prod 1 for(int i=0;i<N;i++){
            if(arr[i]<=max/prod){
                prod*=arr[i];
            }else{
                overflow = true;
            }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            if(arr[i]<=max/prod){
                prod*=arr[i];
            }else{
                overflow = true;
            }
        } {
            if(arr[i]<=max/prod){
                prod*=arr[i];
            }else{
                overflow = true;
            }
        } if(arr[i]<=max/prod){
                prod*=arr[i];
            }else{
                overflow = true;
            } arr[i]<=max/prod arr[i] arr i max/prod max prod {
                prod*=arr[i];
            } prod*=arr[i] prod arr[i] arr i {
                overflow = true;
            } overflow = true overflow true pw.println(overflow?"-1":prod) pw.println pw overflow?"-1":prod overflow "-1" prod pw.flush() pw.flush pw String args[] args public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     } MyScanner BufferedReader br; br StringTokenizer st; st public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        } MyScanner {
           br = new BufferedReader(new InputStreamReader(System.in));
        } br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        } next {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        } while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } st == null || !st.hasMoreElements() st == null st null !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                } IOException 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 int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next double nextDouble() {
            return Double.parseDouble(next());
        } nextDouble {
            return Double.parseDouble(next());
        } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        } nextLine {
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        } String str = ""; str "" try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        } catch (IOException e) {
           e.printStackTrace();
        } IOException e {
           e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
           str = br.readLine();
        } str = br.readLine() str br.readLine() br.readLine br return str; str public class Main {

    static MyScanner ob = new MyScanner();
    static   PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
    static int N ;
    static int [] A;
     static char[][] arr = new char[100][1000];
    public static void main(String args[]) throws IOException {
       int N = ob.nextInt();
       long [] arr = new long[N];
       boolean zero = false;
       for(int i=0;i<N;i++){
           arr[i] = ob.nextLong();
           if(arr[i]==0){
               zero = true;
           }
       }
       long max = 10;
       for(int i=0;i<17;i++){
           max*=10;
       }
       if(zero){
           pw.println(0);
       }else{
           boolean overflow = false;
           long prod = 1;
        for(int i=0;i<N;i++){
            if(arr[i]<=max/prod){
                prod*=arr[i];
            }else{
                overflow = true;
            }
        }
        pw.println(overflow?"-1":prod);
       }    
    
        pw.flush();
    }


    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
} public class Main {

    static MyScanner ob = new MyScanner();
    static   PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
    static int N ;
    static int [] A;
     static char[][] arr = new char[100][1000];
    public static void main(String args[]) throws IOException {
       int N = ob.nextInt();
       long [] arr = new long[N];
       boolean zero = false;
       for(int i=0;i<N;i++){
           arr[i] = ob.nextLong();
           if(arr[i]==0){
               zero = true;
           }
       }
       long max = 10;
       for(int i=0;i<17;i++){
           max*=10;
       }
       if(zero){
           pw.println(0);
       }else{
           boolean overflow = false;
           long prod = 1;
        for(int i=0;i<N;i++){
            if(arr[i]<=max/prod){
                prod*=arr[i];
            }else{
                overflow = true;
            }
        }
        pw.println(overflow?"-1":prod);
       }    
    
        pw.flush();
    }


    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
} Main
import java.io.*;
import java.math.*;
import java.util.*;



public class Main {

    static MyScanner ob = new MyScanner();
    static   PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
    static int N ;
    static int [] A;
     static char[][] arr = new char[100][1000];
    public static void main(String args[]) throws IOException {
       int N = ob.nextInt();
       long [] arr = new long[N];
       boolean zero = false;
       for(int i=0;i<N;i++){
           arr[i] = ob.nextLong();
           if(arr[i]==0){
               zero = true;
           }
       }
       long max = 10;
       for(int i=0;i<17;i++){
           max*=10;
       }
       if(zero){
           pw.println(0);
       }else{
           boolean overflow = false;
           long prod = 1;
        for(int i=0;i<N;i++){
            if(arr[i]<=max/prod){
                prod*=arr[i];
            }else{
                overflow = true;
            }
        }
        pw.println(overflow?"-1":prod);
       }    
    
        pw.flush();
    }


    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
}