import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) list.add(sc.nextLong());
        
        if (list.contains(0L)) {
            System.out.println(0);
            return;
        }

        long result = 1;
        long max = (long) Math.pow(10, 18);
        for (int i = 0; i < n; i++) {
            if (max / result >= list.get(i)) {
                result *= list.get(i);
            } else {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(result);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util 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();
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) list.add(sc.nextLong());
        
        if (list.contains(0L)) {
            System.out.println(0);
            return;
        }

        long result = 1;
        long max = (long) Math.pow(10, 18);
        for (int i = 0; i < n; i++) {
            if (max / result >= list.get(i)) {
                result *= list.get(i);
            } else {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(result);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) list.add(sc.nextLong());
        
        if (list.contains(0L)) {
            System.out.println(0);
            return;
        }

        long result = 1;
        long max = (long) Math.pow(10, 18);
        for (int i = 0; i < n; i++) {
            if (max / result >= list.get(i)) {
                result *= list.get(i);
            } else {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(result);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) list.add(sc.nextLong());
        
        if (list.contains(0L)) {
            System.out.println(0);
            return;
        }

        long result = 1;
        long max = (long) Math.pow(10, 18);
        for (int i = 0; i < n; i++) {
            if (max / result >= list.get(i)) {
                result *= list.get(i);
            } else {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc List<Long> list = new ArrayList<>(); list new ArrayList<>() for (int i = 0; i < n; i++) list.add(sc.nextLong()); int i = 0; int i = 0; i 0 i < n i n i++ i++ i list.add(sc.nextLong()); list.add(sc.nextLong()) list.add list sc.nextLong() sc.nextLong sc if (list.contains(0L)) {
            System.out.println(0);
            return;
        } list.contains(0L) list.contains list 0L {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; long result = 1; result 1 long max = (long) Math.pow(10, 18); max (long) Math.pow(10, 18) Math.pow Math 10 18 for (int i = 0; i < n; i++) {
            if (max / result >= list.get(i)) {
                result *= list.get(i);
            } else {
                System.out.println(-1);
                return;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if (max / result >= list.get(i)) {
                result *= list.get(i);
            } else {
                System.out.println(-1);
                return;
            }
        } {
            if (max / result >= list.get(i)) {
                result *= list.get(i);
            } else {
                System.out.println(-1);
                return;
            }
        } if (max / result >= list.get(i)) {
                result *= list.get(i);
            } else {
                System.out.println(-1);
                return;
            } max / result >= list.get(i) max / result max result list.get(i) list.get list i {
                result *= list.get(i);
            } result *= list.get(i) result list.get(i) list.get list i {
                System.out.println(-1);
                return;
            } System.out.println(-1) System.out.println System.out System System.out -1 1 return; 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 sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) list.add(sc.nextLong());
        
        if (list.contains(0L)) {
            System.out.println(0);
            return;
        }

        long result = 1;
        long max = (long) Math.pow(10, 18);
        for (int i = 0; i < n; i++) {
            if (max / result >= list.get(i)) {
                result *= list.get(i);
            } else {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) list.add(sc.nextLong());
        
        if (list.contains(0L)) {
            System.out.println(0);
            return;
        }

        long result = 1;
        long max = (long) Math.pow(10, 18);
        for (int i = 0; i < n; i++) {
            if (max / result >= list.get(i)) {
                result *= list.get(i);
            } else {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(result);
    }
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) list.add(sc.nextLong());
        
        if (list.contains(0L)) {
            System.out.println(0);
            return;
        }

        long result = 1;
        long max = (long) Math.pow(10, 18);
        for (int i = 0; i < n; i++) {
            if (max / result >= list.get(i)) {
                result *= list.get(i);
            } else {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(result);
    }
}
