import java.math.BigInteger;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long r = 1L;
        boolean existZero = false;
        boolean overThres = false;
        final long thres = 1000000000000000000L;
        for(int i=1; i<=N; i++) {
            long tmp = sc.nextLong();
            if(existZero) continue;
            if(tmp==0L) {
                existZero = true;
                continue;
            }
            long new_r = r * tmp;
            if(new_r> thres || new_r < 0 || new_r < r || new_r < tmp) {
                overThres = true;
            }
            r = new_r;
        }
        if(existZero) {
            System.out.println(0);
            return;
        }
        if(overThres) {
            System.out.println(-1);
            return;
        }
        System.out.println(r);
    }
} import java.math.BigInteger; BigInteger java.math import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long r = 1L;
        boolean existZero = false;
        boolean overThres = false;
        final long thres = 1000000000000000000L;
        for(int i=1; i<=N; i++) {
            long tmp = sc.nextLong();
            if(existZero) continue;
            if(tmp==0L) {
                existZero = true;
                continue;
            }
            long new_r = r * tmp;
            if(new_r> thres || new_r < 0 || new_r < r || new_r < tmp) {
                overThres = true;
            }
            r = new_r;
        }
        if(existZero) {
            System.out.println(0);
            return;
        }
        if(overThres) {
            System.out.println(-1);
            return;
        }
        System.out.println(r);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long r = 1L;
        boolean existZero = false;
        boolean overThres = false;
        final long thres = 1000000000000000000L;
        for(int i=1; i<=N; i++) {
            long tmp = sc.nextLong();
            if(existZero) continue;
            if(tmp==0L) {
                existZero = true;
                continue;
            }
            long new_r = r * tmp;
            if(new_r> thres || new_r < 0 || new_r < r || new_r < tmp) {
                overThres = true;
            }
            r = new_r;
        }
        if(existZero) {
            System.out.println(0);
            return;
        }
        if(overThres) {
            System.out.println(-1);
            return;
        }
        System.out.println(r);
    } main {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long r = 1L;
        boolean existZero = false;
        boolean overThres = false;
        final long thres = 1000000000000000000L;
        for(int i=1; i<=N; i++) {
            long tmp = sc.nextLong();
            if(existZero) continue;
            if(tmp==0L) {
                existZero = true;
                continue;
            }
            long new_r = r * tmp;
            if(new_r> thres || new_r < 0 || new_r < r || new_r < tmp) {
                overThres = true;
            }
            r = new_r;
        }
        if(existZero) {
            System.out.println(0);
            return;
        }
        if(overThres) {
            System.out.println(-1);
            return;
        }
        System.out.println(r);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc long r = 1L; r 1L boolean existZero = false; existZero false boolean overThres = false; overThres false final long thres = 1000000000000000000L; thres 1000000000000000000L for(int i=1; i<=N; i++) {
            long tmp = sc.nextLong();
            if(existZero) continue;
            if(tmp==0L) {
                existZero = true;
                continue;
            }
            long new_r = r * tmp;
            if(new_r> thres || new_r < 0 || new_r < r || new_r < tmp) {
                overThres = true;
            }
            r = new_r;
        } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
            long tmp = sc.nextLong();
            if(existZero) continue;
            if(tmp==0L) {
                existZero = true;
                continue;
            }
            long new_r = r * tmp;
            if(new_r> thres || new_r < 0 || new_r < r || new_r < tmp) {
                overThres = true;
            }
            r = new_r;
        } {
            long tmp = sc.nextLong();
            if(existZero) continue;
            if(tmp==0L) {
                existZero = true;
                continue;
            }
            long new_r = r * tmp;
            if(new_r> thres || new_r < 0 || new_r < r || new_r < tmp) {
                overThres = true;
            }
            r = new_r;
        } long tmp = sc.nextLong(); tmp sc.nextLong() sc.nextLong sc if(existZero) continue; existZero continue; if(tmp==0L) {
                existZero = true;
                continue;
            } tmp==0L tmp 0L {
                existZero = true;
                continue;
            } existZero = true existZero true continue; long new_r = r * tmp; new_r r * tmp r tmp if(new_r> thres || new_r < 0 || new_r < r || new_r < tmp) {
                overThres = true;
            } new_r> thres || new_r < 0 || new_r < r || new_r < tmp new_r < r new_r> thres || new_r < 0 || new_r < r || new_r < tmp new_r> thres new_r thres new_r < 0 new_r 0 new_r < r new_r r new_r < tmp new_r tmp {
                overThres = true;
            } overThres = true overThres true r = new_r r new_r if(existZero) {
            System.out.println(0);
            return;
        } existZero {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; if(overThres) {
            System.out.println(-1);
            return;
        } overThres {
            System.out.println(-1);
            return;
        } System.out.println(-1) System.out.println System.out System System.out -1 1 return; 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) throws Exception {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long r = 1L;
        boolean existZero = false;
        boolean overThres = false;
        final long thres = 1000000000000000000L;
        for(int i=1; i<=N; i++) {
            long tmp = sc.nextLong();
            if(existZero) continue;
            if(tmp==0L) {
                existZero = true;
                continue;
            }
            long new_r = r * tmp;
            if(new_r> thres || new_r < 0 || new_r < r || new_r < tmp) {
                overThres = true;
            }
            r = new_r;
        }
        if(existZero) {
            System.out.println(0);
            return;
        }
        if(overThres) {
            System.out.println(-1);
            return;
        }
        System.out.println(r);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long r = 1L;
        boolean existZero = false;
        boolean overThres = false;
        final long thres = 1000000000000000000L;
        for(int i=1; i<=N; i++) {
            long tmp = sc.nextLong();
            if(existZero) continue;
            if(tmp==0L) {
                existZero = true;
                continue;
            }
            long new_r = r * tmp;
            if(new_r> thres || new_r < 0 || new_r < r || new_r < tmp) {
                overThres = true;
            }
            r = new_r;
        }
        if(existZero) {
            System.out.println(0);
            return;
        }
        if(overThres) {
            System.out.println(-1);
            return;
        }
        System.out.println(r);
    }
} Main
import java.math.BigInteger;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long r = 1L;
        boolean existZero = false;
        boolean overThres = false;
        final long thres = 1000000000000000000L;
        for(int i=1; i<=N; i++) {
            long tmp = sc.nextLong();
            if(existZero) continue;
            if(tmp==0L) {
                existZero = true;
                continue;
            }
            long new_r = r * tmp;
            if(new_r> thres || new_r < 0 || new_r < r || new_r < tmp) {
                overThres = true;
            }
            r = new_r;
        }
        if(existZero) {
            System.out.println(0);
            return;
        }
        if(overThres) {
            System.out.println(-1);
            return;
        }
        System.out.println(r);
    }
}
