import java.math.BigDecimal;
import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int N = Integer.parseInt(sc.next());
        BigDecimal[] A = new BigDecimal[N];
        
        for (int i = 0; i < A.length; i++)
        {
            A[i] = sc.nextBigDecimal();
        }
        
        BigDecimal ans = BigDecimal.ONE;
        BigDecimal tmp = new BigDecimal("1000000000000000000");
        
        for (int i = 0; i < A.length; i++)
        {
            if (A[i].compareTo(BigDecimal.ZERO) == 0)
            {
                System.out.println("0");
                sc.close();
                return;
            }
        }
        
        for (int i = 0; i < A.length; i++)
        {
            if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)
            {
                System.out.println("-1");
                sc.close();
                return;
            }
            else
            {
                ans = ans.multiply(A[i]);
            }
        }
        
        if (ans.compareTo(tmp) == 1)
        {
            System.out.println("-1");
            sc.close();
            return;
        }
        else
        {
            System.out.println(ans);
            sc.close();
            return;
        }
    }
} import java.math.BigDecimal; BigDecimal 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 = Integer.parseInt(sc.next());
        BigDecimal[] A = new BigDecimal[N];
        
        for (int i = 0; i < A.length; i++)
        {
            A[i] = sc.nextBigDecimal();
        }
        
        BigDecimal ans = BigDecimal.ONE;
        BigDecimal tmp = new BigDecimal("1000000000000000000");
        
        for (int i = 0; i < A.length; i++)
        {
            if (A[i].compareTo(BigDecimal.ZERO) == 0)
            {
                System.out.println("0");
                sc.close();
                return;
            }
        }
        
        for (int i = 0; i < A.length; i++)
        {
            if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)
            {
                System.out.println("-1");
                sc.close();
                return;
            }
            else
            {
                ans = ans.multiply(A[i]);
            }
        }
        
        if (ans.compareTo(tmp) == 1)
        {
            System.out.println("-1");
            sc.close();
            return;
        }
        else
        {
            System.out.println(ans);
            sc.close();
            return;
        }
    }
} Main public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int N = Integer.parseInt(sc.next());
        BigDecimal[] A = new BigDecimal[N];
        
        for (int i = 0; i < A.length; i++)
        {
            A[i] = sc.nextBigDecimal();
        }
        
        BigDecimal ans = BigDecimal.ONE;
        BigDecimal tmp = new BigDecimal("1000000000000000000");
        
        for (int i = 0; i < A.length; i++)
        {
            if (A[i].compareTo(BigDecimal.ZERO) == 0)
            {
                System.out.println("0");
                sc.close();
                return;
            }
        }
        
        for (int i = 0; i < A.length; i++)
        {
            if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)
            {
                System.out.println("-1");
                sc.close();
                return;
            }
            else
            {
                ans = ans.multiply(A[i]);
            }
        }
        
        if (ans.compareTo(tmp) == 1)
        {
            System.out.println("-1");
            sc.close();
            return;
        }
        else
        {
            System.out.println(ans);
            sc.close();
            return;
        }
    } main {
        Scanner sc = new Scanner(System.in);
        
        int N = Integer.parseInt(sc.next());
        BigDecimal[] A = new BigDecimal[N];
        
        for (int i = 0; i < A.length; i++)
        {
            A[i] = sc.nextBigDecimal();
        }
        
        BigDecimal ans = BigDecimal.ONE;
        BigDecimal tmp = new BigDecimal("1000000000000000000");
        
        for (int i = 0; i < A.length; i++)
        {
            if (A[i].compareTo(BigDecimal.ZERO) == 0)
            {
                System.out.println("0");
                sc.close();
                return;
            }
        }
        
        for (int i = 0; i < A.length; i++)
        {
            if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)
            {
                System.out.println("-1");
                sc.close();
                return;
            }
            else
            {
                ans = ans.multiply(A[i]);
            }
        }
        
        if (ans.compareTo(tmp) == 1)
        {
            System.out.println("-1");
            sc.close();
            return;
        }
        else
        {
            System.out.println(ans);
            sc.close();
            return;
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc BigDecimal[] A = new BigDecimal[N]; A new BigDecimal[N] N for (int i = 0; i < A.length; i++)
        {
            A[i] = sc.nextBigDecimal();
        } int i = 0; int i = 0; i 0 i < A.length i A.length A A.length i++ i++ i {
            A[i] = sc.nextBigDecimal();
        } {
            A[i] = sc.nextBigDecimal();
        } A[i] = sc.nextBigDecimal() A[i] A i sc.nextBigDecimal() sc.nextBigDecimal sc BigDecimal ans = BigDecimal.ONE; ans BigDecimal.ONE BigDecimal BigDecimal.ONE BigDecimal tmp = new BigDecimal("1000000000000000000"); tmp new BigDecimal("1000000000000000000") for (int i = 0; i < A.length; i++)
        {
            if (A[i].compareTo(BigDecimal.ZERO) == 0)
            {
                System.out.println("0");
                sc.close();
                return;
            }
        } int i = 0; int i = 0; i 0 i < A.length i A.length A A.length i++ i++ i {
            if (A[i].compareTo(BigDecimal.ZERO) == 0)
            {
                System.out.println("0");
                sc.close();
                return;
            }
        } {
            if (A[i].compareTo(BigDecimal.ZERO) == 0)
            {
                System.out.println("0");
                sc.close();
                return;
            }
        } if (A[i].compareTo(BigDecimal.ZERO) == 0)
            {
                System.out.println("0");
                sc.close();
                return;
            } A[i].compareTo(BigDecimal.ZERO) == 0 A[i].compareTo(BigDecimal.ZERO) A[i].compareTo A[i] A i BigDecimal.ZERO BigDecimal BigDecimal.ZERO 0 {
                System.out.println("0");
                sc.close();
                return;
            } System.out.println("0") System.out.println System.out System System.out "0" sc.close() sc.close sc return; for (int i = 0; i < A.length; i++)
        {
            if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)
            {
                System.out.println("-1");
                sc.close();
                return;
            }
            else
            {
                ans = ans.multiply(A[i]);
            }
        } int i = 0; int i = 0; i 0 i < A.length i A.length A A.length i++ i++ i {
            if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)
            {
                System.out.println("-1");
                sc.close();
                return;
            }
            else
            {
                ans = ans.multiply(A[i]);
            }
        } {
            if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)
            {
                System.out.println("-1");
                sc.close();
                return;
            }
            else
            {
                ans = ans.multiply(A[i]);
            }
        } if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)
            {
                System.out.println("-1");
                sc.close();
                return;
            }
            else
            {
                ans = ans.multiply(A[i]);
            } A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1 A[i].compareTo(tmp) == 1 A[i].compareTo(tmp) A[i].compareTo A[i] A i tmp 1 ans.compareTo(tmp) == 1 ans.compareTo(tmp) ans.compareTo ans tmp 1 {
                System.out.println("-1");
                sc.close();
                return;
            } System.out.println("-1") System.out.println System.out System System.out "-1" sc.close() sc.close sc return; {
                ans = ans.multiply(A[i]);
            } ans = ans.multiply(A[i]) ans ans.multiply(A[i]) ans.multiply ans A[i] A i if (ans.compareTo(tmp) == 1)
        {
            System.out.println("-1");
            sc.close();
            return;
        }
        else
        {
            System.out.println(ans);
            sc.close();
            return;
        } ans.compareTo(tmp) == 1 ans.compareTo(tmp) ans.compareTo ans tmp 1 {
            System.out.println("-1");
            sc.close();
            return;
        } System.out.println("-1") System.out.println System.out System System.out "-1" sc.close() sc.close sc return; {
            System.out.println(ans);
            sc.close();
            return;
        } System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc return; String[] args args public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int N = Integer.parseInt(sc.next());
        BigDecimal[] A = new BigDecimal[N];
        
        for (int i = 0; i < A.length; i++)
        {
            A[i] = sc.nextBigDecimal();
        }
        
        BigDecimal ans = BigDecimal.ONE;
        BigDecimal tmp = new BigDecimal("1000000000000000000");
        
        for (int i = 0; i < A.length; i++)
        {
            if (A[i].compareTo(BigDecimal.ZERO) == 0)
            {
                System.out.println("0");
                sc.close();
                return;
            }
        }
        
        for (int i = 0; i < A.length; i++)
        {
            if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)
            {
                System.out.println("-1");
                sc.close();
                return;
            }
            else
            {
                ans = ans.multiply(A[i]);
            }
        }
        
        if (ans.compareTo(tmp) == 1)
        {
            System.out.println("-1");
            sc.close();
            return;
        }
        else
        {
            System.out.println(ans);
            sc.close();
            return;
        }
    }
} public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int N = Integer.parseInt(sc.next());
        BigDecimal[] A = new BigDecimal[N];
        
        for (int i = 0; i < A.length; i++)
        {
            A[i] = sc.nextBigDecimal();
        }
        
        BigDecimal ans = BigDecimal.ONE;
        BigDecimal tmp = new BigDecimal("1000000000000000000");
        
        for (int i = 0; i < A.length; i++)
        {
            if (A[i].compareTo(BigDecimal.ZERO) == 0)
            {
                System.out.println("0");
                sc.close();
                return;
            }
        }
        
        for (int i = 0; i < A.length; i++)
        {
            if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)
            {
                System.out.println("-1");
                sc.close();
                return;
            }
            else
            {
                ans = ans.multiply(A[i]);
            }
        }
        
        if (ans.compareTo(tmp) == 1)
        {
            System.out.println("-1");
            sc.close();
            return;
        }
        else
        {
            System.out.println(ans);
            sc.close();
            return;
        }
    }
} Main
import java.math.BigDecimal;
import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int N = Integer.parseInt(sc.next());
        BigDecimal[] A = new BigDecimal[N];
        
        for (int i = 0; i < A.length; i++)
        {
            A[i] = sc.nextBigDecimal();
        }
        
        BigDecimal ans = BigDecimal.ONE;
        BigDecimal tmp = new BigDecimal("1000000000000000000");
        
        for (int i = 0; i < A.length; i++)
        {
            if (A[i].compareTo(BigDecimal.ZERO) == 0)
            {
                System.out.println("0");
                sc.close();
                return;
            }
        }
        
        for (int i = 0; i < A.length; i++)
        {
            if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)
            {
                System.out.println("-1");
                sc.close();
                return;
            }
            else
            {
                ans = ans.multiply(A[i]);
            }
        }
        
        if (ans.compareTo(tmp) == 1)
        {
            System.out.println("-1");
            sc.close();
            return;
        }
        else
        {
            System.out.println(ans);
            sc.close();
            return;
        }
    }
}
