import java.util.*;
import java.math.BigInteger;
import java.math.RoundingMode;

public class Main {
    public static void main(String[] args) {
      Scanner s = new Scanner(System.in);
        final int N = Integer.parseInt(s.next());
        BigInteger result = new BigInteger("1");
        List<String> aList = new ArrayList<String>();

        for (int i = 0 ; i < N ; i++) {
            aList.add(s.next());
        }

        if (aList.contains("0")) {
            System.out.println(0);
            return;
        }

        for (String aStr : aList) {
            if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger("1000000000000000000")) > 0)  {
                System.out.println(-1);
                return;
            }
            result = result.multiply(new BigInteger(aStr));
        }
        System.out.println(result);
    }
} import java.util.*; util.* java import java.math.BigInteger; BigInteger java.math import java.math.RoundingMode; RoundingMode java.math public class Main {
    public static void main(String[] args) {
      Scanner s = new Scanner(System.in);
        final int N = Integer.parseInt(s.next());
        BigInteger result = new BigInteger("1");
        List<String> aList = new ArrayList<String>();

        for (int i = 0 ; i < N ; i++) {
            aList.add(s.next());
        }

        if (aList.contains("0")) {
            System.out.println(0);
            return;
        }

        for (String aStr : aList) {
            if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger("1000000000000000000")) > 0)  {
                System.out.println(-1);
                return;
            }
            result = result.multiply(new BigInteger(aStr));
        }
        System.out.println(result);
    }
} Main public static void main(String[] args) {
      Scanner s = new Scanner(System.in);
        final int N = Integer.parseInt(s.next());
        BigInteger result = new BigInteger("1");
        List<String> aList = new ArrayList<String>();

        for (int i = 0 ; i < N ; i++) {
            aList.add(s.next());
        }

        if (aList.contains("0")) {
            System.out.println(0);
            return;
        }

        for (String aStr : aList) {
            if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger("1000000000000000000")) > 0)  {
                System.out.println(-1);
                return;
            }
            result = result.multiply(new BigInteger(aStr));
        }
        System.out.println(result);
    } main {
      Scanner s = new Scanner(System.in);
        final int N = Integer.parseInt(s.next());
        BigInteger result = new BigInteger("1");
        List<String> aList = new ArrayList<String>();

        for (int i = 0 ; i < N ; i++) {
            aList.add(s.next());
        }

        if (aList.contains("0")) {
            System.out.println(0);
            return;
        }

        for (String aStr : aList) {
            if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger("1000000000000000000")) > 0)  {
                System.out.println(-1);
                return;
            }
            result = result.multiply(new BigInteger(aStr));
        }
        System.out.println(result);
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) final int N = Integer.parseInt(s.next()); N Integer.parseInt(s.next()) Integer.parseInt Integer s.next() s.next s BigInteger result = new BigInteger("1"); result new BigInteger("1") List<String> aList = new ArrayList<String>(); aList new ArrayList<String>() for (int i = 0 ; i < N ; i++) {
            aList.add(s.next());
        } int i = 0 ; int i = 0 ; i 0 i < N i N i++ i++ i {
            aList.add(s.next());
        } {
            aList.add(s.next());
        } aList.add(s.next()) aList.add aList s.next() s.next s if (aList.contains("0")) {
            System.out.println(0);
            return;
        } aList.contains("0") aList.contains aList "0" {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; for (String aStr : aList) {
            if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger("1000000000000000000")) > 0)  {
                System.out.println(-1);
                return;
            }
            result = result.multiply(new BigInteger(aStr));
        } String aStr aList {
            if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger("1000000000000000000")) > 0)  {
                System.out.println(-1);
                return;
            }
            result = result.multiply(new BigInteger(aStr));
        } {
            if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger("1000000000000000000")) > 0)  {
                System.out.println(-1);
                return;
            }
            result = result.multiply(new BigInteger(aStr));
        } if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger("1000000000000000000")) > 0)  {
                System.out.println(-1);
                return;
            } result.multiply(new BigInteger(aStr)).compareTo(new BigInteger("1000000000000000000")) > 0 result.multiply(new BigInteger(aStr)).compareTo(new BigInteger("1000000000000000000")) result.multiply(new BigInteger(aStr)).compareTo result.multiply(new BigInteger(aStr)) result.multiply result new BigInteger(aStr) new BigInteger("1000000000000000000") 0 {
                System.out.println(-1);
                return;
            } System.out.println(-1) System.out.println System.out System System.out -1 1 return; result = result.multiply(new BigInteger(aStr)) result result.multiply(new BigInteger(aStr)) result.multiply result new BigInteger(aStr) System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) {
      Scanner s = new Scanner(System.in);
        final int N = Integer.parseInt(s.next());
        BigInteger result = new BigInteger("1");
        List<String> aList = new ArrayList<String>();

        for (int i = 0 ; i < N ; i++) {
            aList.add(s.next());
        }

        if (aList.contains("0")) {
            System.out.println(0);
            return;
        }

        for (String aStr : aList) {
            if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger("1000000000000000000")) > 0)  {
                System.out.println(-1);
                return;
            }
            result = result.multiply(new BigInteger(aStr));
        }
        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
      Scanner s = new Scanner(System.in);
        final int N = Integer.parseInt(s.next());
        BigInteger result = new BigInteger("1");
        List<String> aList = new ArrayList<String>();

        for (int i = 0 ; i < N ; i++) {
            aList.add(s.next());
        }

        if (aList.contains("0")) {
            System.out.println(0);
            return;
        }

        for (String aStr : aList) {
            if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger("1000000000000000000")) > 0)  {
                System.out.println(-1);
                return;
            }
            result = result.multiply(new BigInteger(aStr));
        }
        System.out.println(result);
    }
} Main
import java.util.*;
import java.math.BigInteger;
import java.math.RoundingMode;

public class Main {
    public static void main(String[] args) {
      Scanner s = new Scanner(System.in);
        final int N = Integer.parseInt(s.next());
        BigInteger result = new BigInteger("1");
        List<String> aList = new ArrayList<String>();

        for (int i = 0 ; i < N ; i++) {
            aList.add(s.next());
        }

        if (aList.contains("0")) {
            System.out.println(0);
            return;
        }

        for (String aStr : aList) {
            if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger("1000000000000000000")) > 0)  {
                System.out.println(-1);
                return;
            }
            result = result.multiply(new BigInteger(aStr));
        }
        System.out.println(result);
    }
}