import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class Main {
    static int ffact(int n)
    {
        if(n%2==0)
            return 2;
        for(int i=3;i*i<=n;i++)
        {
            if(n%i==0)
                return i;
        }
        return n;
    }

    public static void main(String[] args) {
        InputReader sc = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        Random gen = new Random();
        int test = 1;//sc.nextInt();
        while(test-->0) {

            int n = sc.nextInt();
           long [] ar = new long[n];
           long max = (long)Math.pow(10,18);
           long res = 1;
           boolean flag = true;
           boolean z = false;
            for(int i=0;i<n;i++)
            {
                ar[i] = sc.nextLong();
                if(ar[i]==0)
                    z = true;
            }

            for(long  i : ar)
            {
                if(max/res<i)
                {
                    flag = false;
                    break;
                }
                else
                {
                    res*=i;
                }
            }
            if(z)
                pw.println(0);
            else {
                if (flag)
                    pw.println(res);
                else
                    pw.println(-1);
            }

        }
        pw.close();

    }



























































































































































































    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;

        public InputReader(InputStream st) {
            this.stream = st;
        }

        public int read() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int [] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public static int[] shuffle(int[] a, Random gen)
        { for(int i = 0, n = a.length;i < n;i++)
        { int ind = gen.nextInt(n-i)+i;
            int d = a[i];
            a[i] = a[ind];
            a[ind] = d;

        }
            return a;
        }


        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

    }

} import java.io.*; io.* java import java.math.BigInteger; BigInteger java.math import java.util.*; util.* java public class Main {
    static int ffact(int n)
    {
        if(n%2==0)
            return 2;
        for(int i=3;i*i<=n;i++)
        {
            if(n%i==0)
                return i;
        }
        return n;
    }

    public static void main(String[] args) {
        InputReader sc = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        Random gen = new Random();
        int test = 1;//sc.nextInt();
        while(test-->0) {

            int n = sc.nextInt();
           long [] ar = new long[n];
           long max = (long)Math.pow(10,18);
           long res = 1;
           boolean flag = true;
           boolean z = false;
            for(int i=0;i<n;i++)
            {
                ar[i] = sc.nextLong();
                if(ar[i]==0)
                    z = true;
            }

            for(long  i : ar)
            {
                if(max/res<i)
                {
                    flag = false;
                    break;
                }
                else
                {
                    res*=i;
                }
            }
            if(z)
                pw.println(0);
            else {
                if (flag)
                    pw.println(res);
                else
                    pw.println(-1);
            }

        }
        pw.close();

    }



























































































































































































    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;

        public InputReader(InputStream st) {
            this.stream = st;
        }

        public int read() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int [] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public static int[] shuffle(int[] a, Random gen)
        { for(int i = 0, n = a.length;i < n;i++)
        { int ind = gen.nextInt(n-i)+i;
            int d = a[i];
            a[i] = a[ind];
            a[ind] = d;

        }
            return a;
        }


        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

    }

} Main static int ffact(int n)
    {
        if(n%2==0)
            return 2;
        for(int i=3;i*i<=n;i++)
        {
            if(n%i==0)
                return i;
        }
        return n;
    } ffact {
        if(n%2==0)
            return 2;
        for(int i=3;i*i<=n;i++)
        {
            if(n%i==0)
                return i;
        }
        return n;
    } if(n%2==0)
            return 2; n%2==0 n%2 n 2 0 return 2; 2 for(int i=3;i*i<=n;i++)
        {
            if(n%i==0)
                return i;
        } int i=3; int i=3; i 3 i*i<=n i*i i i n i++ i++ i {
            if(n%i==0)
                return i;
        } {
            if(n%i==0)
                return i;
        } if(n%i==0)
                return i; n%i==0 n%i n i 0 return i; i return n; n int n n public static void main(String[] args) {
        InputReader sc = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        Random gen = new Random();
        int test = 1;//sc.nextInt();
        while(test-->0) {

            int n = sc.nextInt();
           long [] ar = new long[n];
           long max = (long)Math.pow(10,18);
           long res = 1;
           boolean flag = true;
           boolean z = false;
            for(int i=0;i<n;i++)
            {
                ar[i] = sc.nextLong();
                if(ar[i]==0)
                    z = true;
            }

            for(long  i : ar)
            {
                if(max/res<i)
                {
                    flag = false;
                    break;
                }
                else
                {
                    res*=i;
                }
            }
            if(z)
                pw.println(0);
            else {
                if (flag)
                    pw.println(res);
                else
                    pw.println(-1);
            }

        }
        pw.close();

    } main {
        InputReader sc = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        Random gen = new Random();
        int test = 1;//sc.nextInt();
        while(test-->0) {

            int n = sc.nextInt();
           long [] ar = new long[n];
           long max = (long)Math.pow(10,18);
           long res = 1;
           boolean flag = true;
           boolean z = false;
            for(int i=0;i<n;i++)
            {
                ar[i] = sc.nextLong();
                if(ar[i]==0)
                    z = true;
            }

            for(long  i : ar)
            {
                if(max/res<i)
                {
                    flag = false;
                    break;
                }
                else
                {
                    res*=i;
                }
            }
            if(z)
                pw.println(0);
            else {
                if (flag)
                    pw.println(res);
                else
                    pw.println(-1);
            }

        }
        pw.close();

    } InputReader sc = new InputReader(System.in); sc new InputReader(System.in) PrintWriter pw = new PrintWriter(System.out); pw new PrintWriter(System.out) Random gen = new Random(); gen new Random() int test = 1; test 1 while(test-->0) {

            int n = sc.nextInt();
           long [] ar = new long[n];
           long max = (long)Math.pow(10,18);
           long res = 1;
           boolean flag = true;
           boolean z = false;
            for(int i=0;i<n;i++)
            {
                ar[i] = sc.nextLong();
                if(ar[i]==0)
                    z = true;
            }

            for(long  i : ar)
            {
                if(max/res<i)
                {
                    flag = false;
                    break;
                }
                else
                {
                    res*=i;
                }
            }
            if(z)
                pw.println(0);
            else {
                if (flag)
                    pw.println(res);
                else
                    pw.println(-1);
            }

        } test-->0 test-- test 0 {

            int n = sc.nextInt();
           long [] ar = new long[n];
           long max = (long)Math.pow(10,18);
           long res = 1;
           boolean flag = true;
           boolean z = false;
            for(int i=0;i<n;i++)
            {
                ar[i] = sc.nextLong();
                if(ar[i]==0)
                    z = true;
            }

            for(long  i : ar)
            {
                if(max/res<i)
                {
                    flag = false;
                    break;
                }
                else
                {
                    res*=i;
                }
            }
            if(z)
                pw.println(0);
            else {
                if (flag)
                    pw.println(res);
                else
                    pw.println(-1);
            }

        } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long [] ar = new long[n]; ar new long[n] n long max = (long)Math.pow(10,18); max (long)Math.pow(10,18) Math.pow Math 10 18 long res = 1; res 1 boolean flag = true; flag true boolean z = false; z false for(int i=0;i<n;i++)
            {
                ar[i] = sc.nextLong();
                if(ar[i]==0)
                    z = true;
            } int i=0; int i=0; i 0 i<n i n i++ i++ i {
                ar[i] = sc.nextLong();
                if(ar[i]==0)
                    z = true;
            } {
                ar[i] = sc.nextLong();
                if(ar[i]==0)
                    z = true;
            } ar[i] = sc.nextLong() ar[i] ar i sc.nextLong() sc.nextLong sc if(ar[i]==0)
                    z = true; ar[i]==0 ar[i] ar i 0 z = true z true for(long  i : ar)
            {
                if(max/res<i)
                {
                    flag = false;
                    break;
                }
                else
                {
                    res*=i;
                }
            } long  i ar {
                if(max/res<i)
                {
                    flag = false;
                    break;
                }
                else
                {
                    res*=i;
                }
            } {
                if(max/res<i)
                {
                    flag = false;
                    break;
                }
                else
                {
                    res*=i;
                }
            } if(max/res<i)
                {
                    flag = false;
                    break;
                }
                else
                {
                    res*=i;
                } max/res<i max/res max res i {
                    flag = false;
                    break;
                } flag = false flag false break; {
                    res*=i;
                } res*=i res i if(z)
                pw.println(0);
            else {
                if (flag)
                    pw.println(res);
                else
                    pw.println(-1);
            } z pw.println(0) pw.println pw 0 {
                if (flag)
                    pw.println(res);
                else
                    pw.println(-1);
            } if (flag)
                    pw.println(res);
                else
                    pw.println(-1); flag pw.println(res) pw.println pw res pw.println(-1) pw.println pw -1 1 pw.close() pw.close pw String[] args args static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;

        public InputReader(InputStream st) {
            this.stream = st;
        }

        public int read() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int [] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public static int[] shuffle(int[] a, Random gen)
        { for(int i = 0, n = a.length;i < n;i++)
        { int ind = gen.nextInt(n-i)+i;
            int d = a[i];
            a[i] = a[ind];
            a[ind] = d;

        }
            return a;
        }


        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

    } InputReader private final InputStream stream; stream private final byte[] buf = new byte[8192]; buf new byte[8192] 8192 private int curChar curChar snumChars; snumChars public InputReader(InputStream st) {
            this.stream = st;
        } InputReader {
            this.stream = st;
        } this.stream = st this.stream this this.stream st InputStream st st public int read() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        } read {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        } if (snumChars == -1)
                throw new InputMismatchException(); snumChars == -1 snumChars -1 1 throw new InputMismatchException(); new InputMismatchException() if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            } curChar >= snumChars curChar snumChars {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            } curChar = 0 curChar 0 try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                } catch (IOException e) {
                    throw new InputMismatchException();
                } IOException e {
                    throw new InputMismatchException();
                } throw new InputMismatchException(); new InputMismatchException() {
                    snumChars = stream.read(buf);
                } snumChars = stream.read(buf) snumChars stream.read(buf) stream.read stream buf if (snumChars <= 0)
                    return -1; snumChars <= 0 snumChars 0 return -1; -1 1 return buf[curChar++]; buf[curChar++] buf curChar++ curChar public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        } nextInt {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        } int c = read(); c read() read while (isSpaceChar(c)) {
                c = read();
            } isSpaceChar(c) isSpaceChar c {
                c = read();
            } c = read() c read() read int sgn = 1; sgn 1 if (c == '-') {
                sgn = -1;
                c = read();
            } c == '-' c '-' {
                sgn = -1;
                c = read();
            } sgn = -1 sgn -1 1 c = read() c read() read int res = 0; res 0 do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
                res *= 10;
                res += c - '0';
                c = read();
            } res *= 10 res 10 res += c - '0' res c - '0' c '0' c = read() c read() read return res * sgn; res * sgn res sgn public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        } nextLong {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        } int c = read(); c read() read while (isSpaceChar(c)) {
                c = read();
            } isSpaceChar(c) isSpaceChar c {
                c = read();
            } c = read() c read() read int sgn = 1; sgn 1 if (c == '-') {
                sgn = -1;
                c = read();
            } c == '-' c '-' {
                sgn = -1;
                c = read();
            } sgn = -1 sgn -1 1 c = read() c read() read long res = 0; res 0 do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
                res *= 10;
                res += c - '0';
                c = read();
            } res *= 10 res 10 res += c - '0' res c - '0' c '0' c = read() c read() read return res * sgn; res * sgn res sgn public int[] nextIntArray(int n) {
            int [] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        } nextIntArray {
            int [] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        } int [] a = new int[n]; a new int[n] n for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                a[i] = nextInt();
            } {
                a[i] = nextInt();
            } a[i] = nextInt() a[i] a i nextInt() nextInt return a; a int n n public static int[] shuffle(int[] a, Random gen)
        { for(int i = 0, n = a.length;i < n;i++)
        { int ind = gen.nextInt(n-i)+i;
            int d = a[i];
            a[i] = a[ind];
            a[ind] = d;

        }
            return a;
        } shuffle { for(int i = 0, n = a.length;i < n;i++)
        { int ind = gen.nextInt(n-i)+i;
            int d = a[i];
            a[i] = a[ind];
            a[ind] = d;

        }
            return a;
        } for(int i = 0, n = a.length;i < n;i++)
        { int ind = gen.nextInt(n-i)+i;
            int d = a[i];
            a[i] = a[ind];
            a[ind] = d;

        } int i = 0, n = a.length; int i = 0 i 0 n = a.length; n a.length a a.length i < n i n i++ i++ i { int ind = gen.nextInt(n-i)+i;
            int d = a[i];
            a[i] = a[ind];
            a[ind] = d;

        } { int ind = gen.nextInt(n-i)+i;
            int d = a[i];
            a[i] = a[ind];
            a[ind] = d;

        } int ind = gen.nextInt(n-i)+i; ind gen.nextInt(n-i)+i gen.nextInt(n-i) gen.nextInt gen n-i n i i int d = a[i]; d a[i] a i a[i] = a[ind] a[i] a i a[ind] a ind a[ind] = d a[ind] a ind d return a; a int[] a a Random gen gen public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        } readString {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        } int c = read(); c read() read while (isSpaceChar(c)) {
                c = read();
            } isSpaceChar(c) isSpaceChar c {
                c = read();
            } c = read() c read() read StringBuilder res = new StringBuilder(); res new StringBuilder() do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
                res.appendCodePoint(c);
                c = read();
            } res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        } nextLine {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        } int c = read(); c read() read while (isSpaceChar(c))
                c = read(); isSpaceChar(c) isSpaceChar c c = read() c read() read StringBuilder res = new StringBuilder(); res new StringBuilder() do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c)); !isEndOfLine(c) isEndOfLine(c) isEndOfLine c {
                res.appendCodePoint(c);
                c = read();
            } res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        } isSpaceChar {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        } return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == '\t' c == '\r' c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == ' ' c ' ' c == '\n' c '\n' c == '\r' c '\r' c == '\t' c '\t' c == -1 c -1 1 int c c private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        } isEndOfLine {
            return c == '\n' || c == '\r' || c == -1;
        } return c == '\n' || c == '\r' || c == -1; c == '\n' || c == '\r' || c == -1 c == '\n' || c == '\r' || c == -1 c == '\n' c '\n' c == '\r' c '\r' c == -1 c -1 1 int c c public class Main {
    static int ffact(int n)
    {
        if(n%2==0)
            return 2;
        for(int i=3;i*i<=n;i++)
        {
            if(n%i==0)
                return i;
        }
        return n;
    }

    public static void main(String[] args) {
        InputReader sc = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        Random gen = new Random();
        int test = 1;//sc.nextInt();
        while(test-->0) {

            int n = sc.nextInt();
           long [] ar = new long[n];
           long max = (long)Math.pow(10,18);
           long res = 1;
           boolean flag = true;
           boolean z = false;
            for(int i=0;i<n;i++)
            {
                ar[i] = sc.nextLong();
                if(ar[i]==0)
                    z = true;
            }

            for(long  i : ar)
            {
                if(max/res<i)
                {
                    flag = false;
                    break;
                }
                else
                {
                    res*=i;
                }
            }
            if(z)
                pw.println(0);
            else {
                if (flag)
                    pw.println(res);
                else
                    pw.println(-1);
            }

        }
        pw.close();

    }



























































































































































































    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;

        public InputReader(InputStream st) {
            this.stream = st;
        }

        public int read() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int [] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public static int[] shuffle(int[] a, Random gen)
        { for(int i = 0, n = a.length;i < n;i++)
        { int ind = gen.nextInt(n-i)+i;
            int d = a[i];
            a[i] = a[ind];
            a[ind] = d;

        }
            return a;
        }


        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

    }

} public class Main {
    static int ffact(int n)
    {
        if(n%2==0)
            return 2;
        for(int i=3;i*i<=n;i++)
        {
            if(n%i==0)
                return i;
        }
        return n;
    }

    public static void main(String[] args) {
        InputReader sc = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        Random gen = new Random();
        int test = 1;//sc.nextInt();
        while(test-->0) {

            int n = sc.nextInt();
           long [] ar = new long[n];
           long max = (long)Math.pow(10,18);
           long res = 1;
           boolean flag = true;
           boolean z = false;
            for(int i=0;i<n;i++)
            {
                ar[i] = sc.nextLong();
                if(ar[i]==0)
                    z = true;
            }

            for(long  i : ar)
            {
                if(max/res<i)
                {
                    flag = false;
                    break;
                }
                else
                {
                    res*=i;
                }
            }
            if(z)
                pw.println(0);
            else {
                if (flag)
                    pw.println(res);
                else
                    pw.println(-1);
            }

        }
        pw.close();

    }



























































































































































































    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;

        public InputReader(InputStream st) {
            this.stream = st;
        }

        public int read() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int [] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public static int[] shuffle(int[] a, Random gen)
        { for(int i = 0, n = a.length;i < n;i++)
        { int ind = gen.nextInt(n-i)+i;
            int d = a[i];
            a[i] = a[ind];
            a[ind] = d;

        }
            return a;
        }


        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

    }

} Main
import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class Main {
    static int ffact(int n)
    {
        if(n%2==0)
            return 2;
        for(int i=3;i*i<=n;i++)
        {
            if(n%i==0)
                return i;
        }
        return n;
    }

    public static void main(String[] args) {
        InputReader sc = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        Random gen = new Random();
        int test = 1;//sc.nextInt();
        while(test-->0) {

            int n = sc.nextInt();
           long [] ar = new long[n];
           long max = (long)Math.pow(10,18);
           long res = 1;
           boolean flag = true;
           boolean z = false;
            for(int i=0;i<n;i++)
            {
                ar[i] = sc.nextLong();
                if(ar[i]==0)
                    z = true;
            }

            for(long  i : ar)
            {
                if(max/res<i)
                {
                    flag = false;
                    break;
                }
                else
                {
                    res*=i;
                }
            }
            if(z)
                pw.println(0);
            else {
                if (flag)
                    pw.println(res);
                else
                    pw.println(-1);
            }

        }
        pw.close();

    }



























































































































































































    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;

        public InputReader(InputStream st) {
            this.stream = st;
        }

        public int read() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int [] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public static int[] shuffle(int[] a, Random gen)
        { for(int i = 0, n = a.length;i < n;i++)
        { int ind = gen.nextInt(n-i)+i;
            int d = a[i];
            a[i] = a[ind];
            a[ind] = d;

        }
            return a;
        }


        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

    }

}
