import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        long THREASHOLD=1000000000000000000L;
        int N = sc.nextInt();
        long[] A = new long[N];
        boolean zero = false;
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextLong();
            if (A[i] == 0) zero = true;
        }
        if (zero) {
            System.out.println("0");
            return;
        }

        long ans = 1;
        for (int i = 0; i < N; i++) {
            if (A[i] > THREASHOLD/ans) {
                ans = -1;
                break;
            }
            ans *= A[i];
        }

        System.out.println(ans);
        return;
    }

} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
} Main public static void main(String[] args) {
        new Solver().run();
    } main {
        new Solver().run();
    } new Solver().run() new Solver().run new Solver() String[] args args class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        long THREASHOLD=1000000000000000000L;
        int N = sc.nextInt();
        long[] A = new long[N];
        boolean zero = false;
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextLong();
            if (A[i] == 0) zero = true;
        }
        if (zero) {
            System.out.println("0");
            return;
        }

        long ans = 1;
        for (int i = 0; i < N; i++) {
            if (A[i] > THREASHOLD/ans) {
                ans = -1;
                break;
            }
            ans *= A[i];
        }

        System.out.println(ans);
        return;
    }

} Solver public void run() {
        Scanner sc = new Scanner(System.in);
        long THREASHOLD=1000000000000000000L;
        int N = sc.nextInt();
        long[] A = new long[N];
        boolean zero = false;
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextLong();
            if (A[i] == 0) zero = true;
        }
        if (zero) {
            System.out.println("0");
            return;
        }

        long ans = 1;
        for (int i = 0; i < N; i++) {
            if (A[i] > THREASHOLD/ans) {
                ans = -1;
                break;
            }
            ans *= A[i];
        }

        System.out.println(ans);
        return;
    } run {
        Scanner sc = new Scanner(System.in);
        long THREASHOLD=1000000000000000000L;
        int N = sc.nextInt();
        long[] A = new long[N];
        boolean zero = false;
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextLong();
            if (A[i] == 0) zero = true;
        }
        if (zero) {
            System.out.println("0");
            return;
        }

        long ans = 1;
        for (int i = 0; i < N; i++) {
            if (A[i] > THREASHOLD/ans) {
                ans = -1;
                break;
            }
            ans *= A[i];
        }

        System.out.println(ans);
        return;
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long THREASHOLD=1000000000000000000L; THREASHOLD 1000000000000000000L int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long[] A = new long[N]; A new long[N] N boolean zero = false; zero false for (int i = 0; i < N; i++) {
            A[i] = sc.nextLong();
            if (A[i] == 0) zero = true;
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            A[i] = sc.nextLong();
            if (A[i] == 0) zero = true;
        } {
            A[i] = sc.nextLong();
            if (A[i] == 0) zero = true;
        } A[i] = sc.nextLong() A[i] A i sc.nextLong() sc.nextLong sc if (A[i] == 0) zero = true; A[i] == 0 A[i] A i 0 zero = true zero true if (zero) {
            System.out.println("0");
            return;
        } zero {
            System.out.println("0");
            return;
        } System.out.println("0") System.out.println System.out System System.out "0" return; long ans = 1; ans 1 for (int i = 0; i < N; i++) {
            if (A[i] > THREASHOLD/ans) {
                ans = -1;
                break;
            }
            ans *= A[i];
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if (A[i] > THREASHOLD/ans) {
                ans = -1;
                break;
            }
            ans *= A[i];
        } {
            if (A[i] > THREASHOLD/ans) {
                ans = -1;
                break;
            }
            ans *= A[i];
        } if (A[i] > THREASHOLD/ans) {
                ans = -1;
                break;
            } A[i] > THREASHOLD/ans A[i] A i THREASHOLD/ans THREASHOLD ans {
                ans = -1;
                break;
            } ans = -1 ans -1 1 break; ans *= A[i] ans A[i] A i System.out.println(ans) System.out.println System.out System System.out ans return;
import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        long THREASHOLD=1000000000000000000L;
        int N = sc.nextInt();
        long[] A = new long[N];
        boolean zero = false;
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextLong();
            if (A[i] == 0) zero = true;
        }
        if (zero) {
            System.out.println("0");
            return;
        }

        long ans = 1;
        for (int i = 0; i < N; i++) {
            if (A[i] > THREASHOLD/ans) {
                ans = -1;
                break;
            }
            ans *= A[i];
        }

        System.out.println(ans);
        return;
    }

}