
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    static PrintWriter out;
    static CF_Reader in;
    static long E = 1000000000000000000L;
    static boolean zeros;

    public static void main(String[] args) throws IOException {
        out = new PrintWriter(new OutputStreamWriter(System.out));
        in = new CF_Reader();


        int n = in.intNext();
        long[] nums = in.nextLongArray(n);
        out.println(solve(n, nums));

        out.close();
    }

    static long solve(int n, long[] nums) throws IOException {
        if (zeros) return 0;
        long res = 1;
        for (int i = 0; i < n; i++) {
            if (res > E/nums[i]) return -1;
            res *= nums[i];
        }

        return res;
    }


    static class CF_Reader {
        BufferedReader br;
        StringTokenizer st;

        public CF_Reader() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine().trim());
            return st.nextToken();
        }

        long longNext() throws IOException {
            return Long.parseLong(next());
        }

        int intNext() throws IOException {
            return Integer.parseInt(next());
        }

        double doubleNext() throws IOException {
            return Double.parseDouble(next());
        }

        char charNext() throws IOException {
            return next().charAt(0);
        }

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

        public long[] nextLongArray(final int n) throws IOException {
            final long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = longNext();
                if (a[i] == 0) zeros = true;
            }
            return a;
        }

        String line() throws IOException {
            return br.readLine().trim();
        }
    }
}
  import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.OutputStreamWriter; OutputStreamWriter java.io import java.io.PrintWriter; PrintWriter java.io import java.util.StringTokenizer; StringTokenizer java.util public class Main {
    static PrintWriter out;
    static CF_Reader in;
    static long E = 1000000000000000000L;
    static boolean zeros;

    public static void main(String[] args) throws IOException {
        out = new PrintWriter(new OutputStreamWriter(System.out));
        in = new CF_Reader();


        int n = in.intNext();
        long[] nums = in.nextLongArray(n);
        out.println(solve(n, nums));

        out.close();
    }

    static long solve(int n, long[] nums) throws IOException {
        if (zeros) return 0;
        long res = 1;
        for (int i = 0; i < n; i++) {
            if (res > E/nums[i]) return -1;
            res *= nums[i];
        }

        return res;
    }


    static class CF_Reader {
        BufferedReader br;
        StringTokenizer st;

        public CF_Reader() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine().trim());
            return st.nextToken();
        }

        long longNext() throws IOException {
            return Long.parseLong(next());
        }

        int intNext() throws IOException {
            return Integer.parseInt(next());
        }

        double doubleNext() throws IOException {
            return Double.parseDouble(next());
        }

        char charNext() throws IOException {
            return next().charAt(0);
        }

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

        public long[] nextLongArray(final int n) throws IOException {
            final long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = longNext();
                if (a[i] == 0) zeros = true;
            }
            return a;
        }

        String line() throws IOException {
            return br.readLine().trim();
        }
    }
} Main static PrintWriter out; out static CF_Reader in; in static long E = 1000000000000000000L; E 1000000000000000000L static boolean zeros; zeros public static void main(String[] args) throws IOException {
        out = new PrintWriter(new OutputStreamWriter(System.out));
        in = new CF_Reader();


        int n = in.intNext();
        long[] nums = in.nextLongArray(n);
        out.println(solve(n, nums));

        out.close();
    } main {
        out = new PrintWriter(new OutputStreamWriter(System.out));
        in = new CF_Reader();


        int n = in.intNext();
        long[] nums = in.nextLongArray(n);
        out.println(solve(n, nums));

        out.close();
    } out = new PrintWriter(new OutputStreamWriter(System.out)) out new PrintWriter(new OutputStreamWriter(System.out)) in = new CF_Reader() in new CF_Reader() int n = in.intNext(); n in.intNext() in.intNext in long[] nums = in.nextLongArray(n); nums in.nextLongArray(n) in.nextLongArray in n out.println(solve(n, nums)) out.println out solve(n, nums) solve n nums out.close() out.close out String[] args args static long solve(int n, long[] nums) throws IOException {
        if (zeros) return 0;
        long res = 1;
        for (int i = 0; i < n; i++) {
            if (res > E/nums[i]) return -1;
            res *= nums[i];
        }

        return res;
    } solve {
        if (zeros) return 0;
        long res = 1;
        for (int i = 0; i < n; i++) {
            if (res > E/nums[i]) return -1;
            res *= nums[i];
        }

        return res;
    } if (zeros) return 0; zeros return 0; 0 long res = 1; res 1 for (int i = 0; i < n; i++) {
            if (res > E/nums[i]) return -1;
            res *= nums[i];
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if (res > E/nums[i]) return -1;
            res *= nums[i];
        } {
            if (res > E/nums[i]) return -1;
            res *= nums[i];
        } if (res > E/nums[i]) return -1; res > E/nums[i] res E/nums[i] E nums[i] nums i return -1; -1 1 res *= nums[i] res nums[i] nums i return res; res int n n long[] nums nums static class CF_Reader {
        BufferedReader br;
        StringTokenizer st;

        public CF_Reader() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine().trim());
            return st.nextToken();
        }

        long longNext() throws IOException {
            return Long.parseLong(next());
        }

        int intNext() throws IOException {
            return Integer.parseInt(next());
        }

        double doubleNext() throws IOException {
            return Double.parseDouble(next());
        }

        char charNext() throws IOException {
            return next().charAt(0);
        }

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

        public long[] nextLongArray(final int n) throws IOException {
            final long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = longNext();
                if (a[i] == 0) zeros = true;
            }
            return a;
        }

        String line() throws IOException {
            return br.readLine().trim();
        }
    } CF_Reader BufferedReader br; br StringTokenizer st; st public CF_Reader() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
        } CF_Reader {
            br = new BufferedReader(new InputStreamReader(System.in));
        } br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine().trim());
            return st.nextToken();
        } next {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine().trim());
            return st.nextToken();
        } while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine().trim()); st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st st = new StringTokenizer(br.readLine().trim()) st new StringTokenizer(br.readLine().trim()) return st.nextToken(); st.nextToken() st.nextToken st long longNext() throws IOException {
            return Long.parseLong(next());
        } longNext {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next int intNext() throws IOException {
            return Integer.parseInt(next());
        } intNext {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next double doubleNext() throws IOException {
            return Double.parseDouble(next());
        } doubleNext {
            return Double.parseDouble(next());
        } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next char charNext() throws IOException {
            return next().charAt(0);
        } charNext {
            return next().charAt(0);
        } return next().charAt(0); next().charAt(0) next().charAt next() next 0 public int[] nextIntArray(final int n) throws IOException {
            final int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = intNext();
            return a;
        } nextIntArray {
            final int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = intNext();
            return a;
        } final int[] a = new int[n]; a new int[n] n for (int i = 0; i < n; i++)
                a[i] = intNext(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = intNext(); a[i] = intNext() a[i] a i intNext() intNext return a; a final int n n public long[] nextLongArray(final int n) throws IOException {
            final long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = longNext();
                if (a[i] == 0) zeros = true;
            }
            return a;
        } nextLongArray {
            final long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = longNext();
                if (a[i] == 0) zeros = true;
            }
            return a;
        } final long[] a = new long[n]; a new long[n] n for (int i = 0; i < n; i++) {
                a[i] = longNext();
                if (a[i] == 0) zeros = true;
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                a[i] = longNext();
                if (a[i] == 0) zeros = true;
            } {
                a[i] = longNext();
                if (a[i] == 0) zeros = true;
            } a[i] = longNext() a[i] a i longNext() longNext if (a[i] == 0) zeros = true; a[i] == 0 a[i] a i 0 zeros = true zeros true return a; a final int n n String line() throws IOException {
            return br.readLine().trim();
        } line {
            return br.readLine().trim();
        } return br.readLine().trim(); br.readLine().trim() br.readLine().trim br.readLine() br.readLine br public class Main {
    static PrintWriter out;
    static CF_Reader in;
    static long E = 1000000000000000000L;
    static boolean zeros;

    public static void main(String[] args) throws IOException {
        out = new PrintWriter(new OutputStreamWriter(System.out));
        in = new CF_Reader();


        int n = in.intNext();
        long[] nums = in.nextLongArray(n);
        out.println(solve(n, nums));

        out.close();
    }

    static long solve(int n, long[] nums) throws IOException {
        if (zeros) return 0;
        long res = 1;
        for (int i = 0; i < n; i++) {
            if (res > E/nums[i]) return -1;
            res *= nums[i];
        }

        return res;
    }


    static class CF_Reader {
        BufferedReader br;
        StringTokenizer st;

        public CF_Reader() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine().trim());
            return st.nextToken();
        }

        long longNext() throws IOException {
            return Long.parseLong(next());
        }

        int intNext() throws IOException {
            return Integer.parseInt(next());
        }

        double doubleNext() throws IOException {
            return Double.parseDouble(next());
        }

        char charNext() throws IOException {
            return next().charAt(0);
        }

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

        public long[] nextLongArray(final int n) throws IOException {
            final long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = longNext();
                if (a[i] == 0) zeros = true;
            }
            return a;
        }

        String line() throws IOException {
            return br.readLine().trim();
        }
    }
} public class Main {
    static PrintWriter out;
    static CF_Reader in;
    static long E = 1000000000000000000L;
    static boolean zeros;

    public static void main(String[] args) throws IOException {
        out = new PrintWriter(new OutputStreamWriter(System.out));
        in = new CF_Reader();


        int n = in.intNext();
        long[] nums = in.nextLongArray(n);
        out.println(solve(n, nums));

        out.close();
    }

    static long solve(int n, long[] nums) throws IOException {
        if (zeros) return 0;
        long res = 1;
        for (int i = 0; i < n; i++) {
            if (res > E/nums[i]) return -1;
            res *= nums[i];
        }

        return res;
    }


    static class CF_Reader {
        BufferedReader br;
        StringTokenizer st;

        public CF_Reader() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine().trim());
            return st.nextToken();
        }

        long longNext() throws IOException {
            return Long.parseLong(next());
        }

        int intNext() throws IOException {
            return Integer.parseInt(next());
        }

        double doubleNext() throws IOException {
            return Double.parseDouble(next());
        }

        char charNext() throws IOException {
            return next().charAt(0);
        }

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

        public long[] nextLongArray(final int n) throws IOException {
            final long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = longNext();
                if (a[i] == 0) zeros = true;
            }
            return a;
        }

        String line() throws IOException {
            return br.readLine().trim();
        }
    }
} Main

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    static PrintWriter out;
    static CF_Reader in;
    static long E = 1000000000000000000L;
    static boolean zeros;

    public static void main(String[] args) throws IOException {
        out = new PrintWriter(new OutputStreamWriter(System.out));
        in = new CF_Reader();


        int n = in.intNext();
        long[] nums = in.nextLongArray(n);
        out.println(solve(n, nums));

        out.close();
    }

    static long solve(int n, long[] nums) throws IOException {
        if (zeros) return 0;
        long res = 1;
        for (int i = 0; i < n; i++) {
            if (res > E/nums[i]) return -1;
            res *= nums[i];
        }

        return res;
    }


    static class CF_Reader {
        BufferedReader br;
        StringTokenizer st;

        public CF_Reader() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine().trim());
            return st.nextToken();
        }

        long longNext() throws IOException {
            return Long.parseLong(next());
        }

        int intNext() throws IOException {
            return Integer.parseInt(next());
        }

        double doubleNext() throws IOException {
            return Double.parseDouble(next());
        }

        char charNext() throws IOException {
            return next().charAt(0);
        }

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

        public long[] nextLongArray(final int n) throws IOException {
            final long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = longNext();
                if (a[i] == 0) zeros = true;
            }
            return a;
        }

        String line() throws IOException {
            return br.readLine().trim();
        }
    }
}
 