import java.math.BigDecimal;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        BigDecimal max = new BigDecimal(Math.pow(10, 18));
        BigDecimal decimal = null;
        boolean overflow = false;

        for (int i = 0; i < n; i++) {
            long val = scanner.nextLong();
            if (val == 0) {
                System.out.println("0");
                System.exit(0);
            }
            if (decimal == null) {
                decimal = new BigDecimal(val);
            } else if (!overflow) {
                decimal = decimal.multiply(new BigDecimal(val));
                if (decimal.compareTo(max) > 0) {
                    overflow = true;
                }
            }
        }

        if (overflow) {
            System.out.println("-1");
        } else {
            System.out.println(decimal);
        }

    }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz