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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        BigInteger ans = new BigInteger("1");
        boolean b = true;
        String[] s = new String[n];
        for (int i=0;i<n&&b;i++){
            s[i]=sc.next();
            if (s[i].equals("0")){
                b=false;
                ans=new BigInteger("0");
            }
        }
        for (int i=0;i<n&&b;i++){
            ans=ans.multiply(new BigInteger(s[i]));
            if (ans.toString().length()>18&& !ans.toString().equals("1000000000000000000")){
                b=false;
                ans = new BigInteger("-1");
            }
        }
        System.out.println(ans.toString());
    }
} import java.math.BigInteger; BigInteger java.math import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        BigInteger ans = new BigInteger("1");
        boolean b = true;
        String[] s = new String[n];
        for (int i=0;i<n&&b;i++){
            s[i]=sc.next();
            if (s[i].equals("0")){
                b=false;
                ans=new BigInteger("0");
            }
        }
        for (int i=0;i<n&&b;i++){
            ans=ans.multiply(new BigInteger(s[i]));
            if (ans.toString().length()>18&& !ans.toString().equals("1000000000000000000")){
                b=false;
                ans = new BigInteger("-1");
            }
        }
        System.out.println(ans.toString());
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        BigInteger ans = new BigInteger("1");
        boolean b = true;
        String[] s = new String[n];
        for (int i=0;i<n&&b;i++){
            s[i]=sc.next();
            if (s[i].equals("0")){
                b=false;
                ans=new BigInteger("0");
            }
        }
        for (int i=0;i<n&&b;i++){
            ans=ans.multiply(new BigInteger(s[i]));
            if (ans.toString().length()>18&& !ans.toString().equals("1000000000000000000")){
                b=false;
                ans = new BigInteger("-1");
            }
        }
        System.out.println(ans.toString());
    } main {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        BigInteger ans = new BigInteger("1");
        boolean b = true;
        String[] s = new String[n];
        for (int i=0;i<n&&b;i++){
            s[i]=sc.next();
            if (s[i].equals("0")){
                b=false;
                ans=new BigInteger("0");
            }
        }
        for (int i=0;i<n&&b;i++){
            ans=ans.multiply(new BigInteger(s[i]));
            if (ans.toString().length()>18&& !ans.toString().equals("1000000000000000000")){
                b=false;
                ans = new BigInteger("-1");
            }
        }
        System.out.println(ans.toString());
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc BigInteger ans = new BigInteger("1"); ans new BigInteger("1") boolean b = true; b true String[] s = new String[n]; s new String[n] n for (int i=0;i<n&&b;i++){
            s[i]=sc.next();
            if (s[i].equals("0")){
                b=false;
                ans=new BigInteger("0");
            }
        } int i=0; int i=0; i 0 i<n&&b i<n i n b i++ i++ i {
            s[i]=sc.next();
            if (s[i].equals("0")){
                b=false;
                ans=new BigInteger("0");
            }
        } {
            s[i]=sc.next();
            if (s[i].equals("0")){
                b=false;
                ans=new BigInteger("0");
            }
        } s[i]=sc.next() s[i] s i sc.next() sc.next sc if (s[i].equals("0")){
                b=false;
                ans=new BigInteger("0");
            } s[i].equals("0") s[i].equals s[i] s i "0" {
                b=false;
                ans=new BigInteger("0");
            } b=false b false ans=new BigInteger("0") ans new BigInteger("0") for (int i=0;i<n&&b;i++){
            ans=ans.multiply(new BigInteger(s[i]));
            if (ans.toString().length()>18&& !ans.toString().equals("1000000000000000000")){
                b=false;
                ans = new BigInteger("-1");
            }
        } int i=0; int i=0; i 0 i<n&&b i<n i n b i++ i++ i {
            ans=ans.multiply(new BigInteger(s[i]));
            if (ans.toString().length()>18&& !ans.toString().equals("1000000000000000000")){
                b=false;
                ans = new BigInteger("-1");
            }
        } {
            ans=ans.multiply(new BigInteger(s[i]));
            if (ans.toString().length()>18&& !ans.toString().equals("1000000000000000000")){
                b=false;
                ans = new BigInteger("-1");
            }
        } ans=ans.multiply(new BigInteger(s[i])) ans ans.multiply(new BigInteger(s[i])) ans.multiply ans new BigInteger(s[i]) if (ans.toString().length()>18&& !ans.toString().equals("1000000000000000000")){
                b=false;
                ans = new BigInteger("-1");
            } ans.toString().length()>18&& !ans.toString().equals("1000000000000000000") ans.toString().length()>18 ans.toString().length() ans.toString().length ans.toString() ans.toString ans 18 !ans.toString().equals("1000000000000000000") ans.toString().equals("1000000000000000000") ans.toString().equals ans.toString() ans.toString ans "1000000000000000000" {
                b=false;
                ans = new BigInteger("-1");
            } b=false b false ans = new BigInteger("-1") ans new BigInteger("-1") System.out.println(ans.toString()) System.out.println System.out System System.out ans.toString() ans.toString ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        BigInteger ans = new BigInteger("1");
        boolean b = true;
        String[] s = new String[n];
        for (int i=0;i<n&&b;i++){
            s[i]=sc.next();
            if (s[i].equals("0")){
                b=false;
                ans=new BigInteger("0");
            }
        }
        for (int i=0;i<n&&b;i++){
            ans=ans.multiply(new BigInteger(s[i]));
            if (ans.toString().length()>18&& !ans.toString().equals("1000000000000000000")){
                b=false;
                ans = new BigInteger("-1");
            }
        }
        System.out.println(ans.toString());
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        BigInteger ans = new BigInteger("1");
        boolean b = true;
        String[] s = new String[n];
        for (int i=0;i<n&&b;i++){
            s[i]=sc.next();
            if (s[i].equals("0")){
                b=false;
                ans=new BigInteger("0");
            }
        }
        for (int i=0;i<n&&b;i++){
            ans=ans.multiply(new BigInteger(s[i]));
            if (ans.toString().length()>18&& !ans.toString().equals("1000000000000000000")){
                b=false;
                ans = new BigInteger("-1");
            }
        }
        System.out.println(ans.toString());
    }
} Main
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        BigInteger ans = new BigInteger("1");
        boolean b = true;
        String[] s = new String[n];
        for (int i=0;i<n&&b;i++){
            s[i]=sc.next();
            if (s[i].equals("0")){
                b=false;
                ans=new BigInteger("0");
            }
        }
        for (int i=0;i<n&&b;i++){
            ans=ans.multiply(new BigInteger(s[i]));
            if (ans.toString().length()>18&& !ans.toString().equals("1000000000000000000")){
                b=false;
                ans = new BigInteger("-1");
            }
        }
        System.out.println(ans.toString());
    }
}
