import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long r = 1;
        long[] a = new long[n];
        boolean flag =false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if(a[i] == 0)  flag = true;
        }
        if (flag) {
            r = 0;
        } else {
            long t = a[0];
            for (int i = 0; i < n; i++) {
                if (i > 0) {
                    r = t * a[i];
                    if (r > 1000000000000000000L || r < t) {
                        r = -1;
                        break;
                    }
                    t = r;
                }
            }
        }

        System.out.println(r);
    }
} 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();
        long r = 1;
        long[] a = new long[n];
        boolean flag =false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if(a[i] == 0)  flag = true;
        }
        if (flag) {
            r = 0;
        } else {
            long t = a[0];
            for (int i = 0; i < n; i++) {
                if (i > 0) {
                    r = t * a[i];
                    if (r > 1000000000000000000L || r < t) {
                        r = -1;
                        break;
                    }
                    t = r;
                }
            }
        }

        System.out.println(r);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long r = 1;
        long[] a = new long[n];
        boolean flag =false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if(a[i] == 0)  flag = true;
        }
        if (flag) {
            r = 0;
        } else {
            long t = a[0];
            for (int i = 0; i < n; i++) {
                if (i > 0) {
                    r = t * a[i];
                    if (r > 1000000000000000000L || r < t) {
                        r = -1;
                        break;
                    }
                    t = r;
                }
            }
        }

        System.out.println(r);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long r = 1;
        long[] a = new long[n];
        boolean flag =false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if(a[i] == 0)  flag = true;
        }
        if (flag) {
            r = 0;
        } else {
            long t = a[0];
            for (int i = 0; i < n; i++) {
                if (i > 0) {
                    r = t * a[i];
                    if (r > 1000000000000000000L || r < t) {
                        r = -1;
                        break;
                    }
                    t = r;
                }
            }
        }

        System.out.println(r);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long r = 1; r 1 long[] a = new long[n]; a new long[n] n boolean flag =false; flag false for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if(a[i] == 0)  flag = true;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a[i] = sc.nextLong();
            if(a[i] == 0)  flag = true;
        } {
            a[i] = sc.nextLong();
            if(a[i] == 0)  flag = true;
        } a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc if(a[i] == 0)  flag = true; a[i] == 0 a[i] a i 0 flag = true flag true if (flag) {
            r = 0;
        } else {
            long t = a[0];
            for (int i = 0; i < n; i++) {
                if (i > 0) {
                    r = t * a[i];
                    if (r > 1000000000000000000L || r < t) {
                        r = -1;
                        break;
                    }
                    t = r;
                }
            }
        } flag {
            r = 0;
        } r = 0 r 0 {
            long t = a[0];
            for (int i = 0; i < n; i++) {
                if (i > 0) {
                    r = t * a[i];
                    if (r > 1000000000000000000L || r < t) {
                        r = -1;
                        break;
                    }
                    t = r;
                }
            }
        } long t = a[0]; t a[0] a 0 for (int i = 0; i < n; i++) {
                if (i > 0) {
                    r = t * a[i];
                    if (r > 1000000000000000000L || r < t) {
                        r = -1;
                        break;
                    }
                    t = r;
                }
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                if (i > 0) {
                    r = t * a[i];
                    if (r > 1000000000000000000L || r < t) {
                        r = -1;
                        break;
                    }
                    t = r;
                }
            } {
                if (i > 0) {
                    r = t * a[i];
                    if (r > 1000000000000000000L || r < t) {
                        r = -1;
                        break;
                    }
                    t = r;
                }
            } if (i > 0) {
                    r = t * a[i];
                    if (r > 1000000000000000000L || r < t) {
                        r = -1;
                        break;
                    }
                    t = r;
                } i > 0 i 0 {
                    r = t * a[i];
                    if (r > 1000000000000000000L || r < t) {
                        r = -1;
                        break;
                    }
                    t = r;
                } r = t * a[i] r t * a[i] t a[i] a i if (r > 1000000000000000000L || r < t) {
                        r = -1;
                        break;
                    } r > 1000000000000000000L || r < t r > 1000000000000000000L r 1000000000000000000L r < t r t {
                        r = -1;
                        break;
                    } r = -1 r -1 1 break; t = r t r System.out.println(r) System.out.println System.out System System.out r String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long r = 1;
        long[] a = new long[n];
        boolean flag =false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if(a[i] == 0)  flag = true;
        }
        if (flag) {
            r = 0;
        } else {
            long t = a[0];
            for (int i = 0; i < n; i++) {
                if (i > 0) {
                    r = t * a[i];
                    if (r > 1000000000000000000L || r < t) {
                        r = -1;
                        break;
                    }
                    t = r;
                }
            }
        }

        System.out.println(r);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long r = 1;
        long[] a = new long[n];
        boolean flag =false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if(a[i] == 0)  flag = true;
        }
        if (flag) {
            r = 0;
        } else {
            long t = a[0];
            for (int i = 0; i < n; i++) {
                if (i > 0) {
                    r = t * a[i];
                    if (r > 1000000000000000000L || r < t) {
                        r = -1;
                        break;
                    }
                    t = r;
                }
            }
        }

        System.out.println(r);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long r = 1;
        long[] a = new long[n];
        boolean flag =false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if(a[i] == 0)  flag = true;
        }
        if (flag) {
            r = 0;
        } else {
            long t = a[0];
            for (int i = 0; i < n; i++) {
                if (i > 0) {
                    r = t * a[i];
                    if (r > 1000000000000000000L || r < t) {
                        r = -1;
                        break;
                    }
                    t = r;
                }
            }
        }

        System.out.println(r);
    }
}