import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = nextInt(scanner);
        long[] a = new long[n];
        long p = 1;
        boolean isZero = false;
        for (int i = 0; i < n; i++) {
            a[i] = Long.parseLong(scanner.next());
            if (a[i] == 0) {
                isZero = true;
            }
        }
        if (isZero) {
            System.out.println(0);
            return;
        }
        try {
            for (int i = 0; i < n; i++) {
                p = Math.multiplyExact(p, a[i]);
            }
        }catch (Exception e) {
            System.out.println(-1);
            return;
        }
        if (p > 1000000000000000000L) {
            System.out.println(-1);
            return;
        }
        System.out.println(p);


    }

    public static int nextInt(Scanner scanner) {
        return Integer.parseInt(scanner.next());
    }

}


 import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = nextInt(scanner);
        long[] a = new long[n];
        long p = 1;
        boolean isZero = false;
        for (int i = 0; i < n; i++) {
            a[i] = Long.parseLong(scanner.next());
            if (a[i] == 0) {
                isZero = true;
            }
        }
        if (isZero) {
            System.out.println(0);
            return;
        }
        try {
            for (int i = 0; i < n; i++) {
                p = Math.multiplyExact(p, a[i]);
            }
        }catch (Exception e) {
            System.out.println(-1);
            return;
        }
        if (p > 1000000000000000000L) {
            System.out.println(-1);
            return;
        }
        System.out.println(p);


    }

    public static int nextInt(Scanner scanner) {
        return Integer.parseInt(scanner.next());
    }

} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = nextInt(scanner);
        long[] a = new long[n];
        long p = 1;
        boolean isZero = false;
        for (int i = 0; i < n; i++) {
            a[i] = Long.parseLong(scanner.next());
            if (a[i] == 0) {
                isZero = true;
            }
        }
        if (isZero) {
            System.out.println(0);
            return;
        }
        try {
            for (int i = 0; i < n; i++) {
                p = Math.multiplyExact(p, a[i]);
            }
        }catch (Exception e) {
            System.out.println(-1);
            return;
        }
        if (p > 1000000000000000000L) {
            System.out.println(-1);
            return;
        }
        System.out.println(p);


    } main {
        Scanner scanner = new Scanner(System.in);
        int n = nextInt(scanner);
        long[] a = new long[n];
        long p = 1;
        boolean isZero = false;
        for (int i = 0; i < n; i++) {
            a[i] = Long.parseLong(scanner.next());
            if (a[i] == 0) {
                isZero = true;
            }
        }
        if (isZero) {
            System.out.println(0);
            return;
        }
        try {
            for (int i = 0; i < n; i++) {
                p = Math.multiplyExact(p, a[i]);
            }
        }catch (Exception e) {
            System.out.println(-1);
            return;
        }
        if (p > 1000000000000000000L) {
            System.out.println(-1);
            return;
        }
        System.out.println(p);


    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = nextInt(scanner); n nextInt(scanner) nextInt scanner long[] a = new long[n]; a new long[n] n long p = 1; p 1 boolean isZero = false; isZero false for (int i = 0; i < n; i++) {
            a[i] = Long.parseLong(scanner.next());
            if (a[i] == 0) {
                isZero = true;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a[i] = Long.parseLong(scanner.next());
            if (a[i] == 0) {
                isZero = true;
            }
        } {
            a[i] = Long.parseLong(scanner.next());
            if (a[i] == 0) {
                isZero = true;
            }
        } a[i] = Long.parseLong(scanner.next()) a[i] a i Long.parseLong(scanner.next()) Long.parseLong Long scanner.next() scanner.next scanner if (a[i] == 0) {
                isZero = true;
            } a[i] == 0 a[i] a i 0 {
                isZero = true;
            } isZero = true isZero true if (isZero) {
            System.out.println(0);
            return;
        } isZero {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; try {
            for (int i = 0; i < n; i++) {
                p = Math.multiplyExact(p, a[i]);
            }
        }catch (Exception e) {
            System.out.println(-1);
            return;
        } catch (Exception e) {
            System.out.println(-1);
            return;
        } Exception e {
            System.out.println(-1);
            return;
        } System.out.println(-1) System.out.println System.out System System.out -1 1 return; {
            for (int i = 0; i < n; i++) {
                p = Math.multiplyExact(p, a[i]);
            }
        } for (int i = 0; i < n; i++) {
                p = Math.multiplyExact(p, a[i]);
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                p = Math.multiplyExact(p, a[i]);
            } {
                p = Math.multiplyExact(p, a[i]);
            } p = Math.multiplyExact(p, a[i]) p Math.multiplyExact(p, a[i]) Math.multiplyExact Math p a[i] a i if (p > 1000000000000000000L) {
            System.out.println(-1);
            return;
        } p > 1000000000000000000L p 1000000000000000000L {
            System.out.println(-1);
            return;
        } System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(p) System.out.println System.out System System.out p String[] args args public static int nextInt(Scanner scanner) {
        return Integer.parseInt(scanner.next());
    } nextInt {
        return Integer.parseInt(scanner.next());
    } return Integer.parseInt(scanner.next()); Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner Scanner scanner scanner public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = nextInt(scanner);
        long[] a = new long[n];
        long p = 1;
        boolean isZero = false;
        for (int i = 0; i < n; i++) {
            a[i] = Long.parseLong(scanner.next());
            if (a[i] == 0) {
                isZero = true;
            }
        }
        if (isZero) {
            System.out.println(0);
            return;
        }
        try {
            for (int i = 0; i < n; i++) {
                p = Math.multiplyExact(p, a[i]);
            }
        }catch (Exception e) {
            System.out.println(-1);
            return;
        }
        if (p > 1000000000000000000L) {
            System.out.println(-1);
            return;
        }
        System.out.println(p);


    }

    public static int nextInt(Scanner scanner) {
        return Integer.parseInt(scanner.next());
    }

} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = nextInt(scanner);
        long[] a = new long[n];
        long p = 1;
        boolean isZero = false;
        for (int i = 0; i < n; i++) {
            a[i] = Long.parseLong(scanner.next());
            if (a[i] == 0) {
                isZero = true;
            }
        }
        if (isZero) {
            System.out.println(0);
            return;
        }
        try {
            for (int i = 0; i < n; i++) {
                p = Math.multiplyExact(p, a[i]);
            }
        }catch (Exception e) {
            System.out.println(-1);
            return;
        }
        if (p > 1000000000000000000L) {
            System.out.println(-1);
            return;
        }
        System.out.println(p);


    }

    public static int nextInt(Scanner scanner) {
        return Integer.parseInt(scanner.next());
    }

} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = nextInt(scanner);
        long[] a = new long[n];
        long p = 1;
        boolean isZero = false;
        for (int i = 0; i < n; i++) {
            a[i] = Long.parseLong(scanner.next());
            if (a[i] == 0) {
                isZero = true;
            }
        }
        if (isZero) {
            System.out.println(0);
            return;
        }
        try {
            for (int i = 0; i < n; i++) {
                p = Math.multiplyExact(p, a[i]);
            }
        }catch (Exception e) {
            System.out.println(-1);
            return;
        }
        if (p > 1000000000000000000L) {
            System.out.println(-1);
            return;
        }
        System.out.println(p);


    }

    public static int nextInt(Scanner scanner) {
        return Integer.parseInt(scanner.next());
    }

}



