import java.util.*;
import java.io.*;
public class Main {
    public static void main (String [] args) throws IOException 
    {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        
        int len = Integer.parseInt(in.readLine());

        StringTokenizer s = new StringTokenizer(in.readLine());

        boolean isZero = false;
        boolean tooLong = false;
        long[] nums = new long[len];
        for(int i = 0; i < len; i++)
        {
            nums[i] = Long.parseLong(s.nextToken());
            if(nums[i] == 0)
            {
                isZero = true;
            }
        }
        long result = 1;
        
        for(int i = 0; i < len && !isZero; i++)
        {
            if(1000000000000000000L/nums[i] >= result)
            {
                result *= nums[i];
            }
            else
            {
                tooLong = true;
                break;
            }
        }

        if(isZero)
        {
            System.out.println(0);
        }
        else if(tooLong)
        {
            System.out.println(-1);
        }
        else
        {
            System.out.println(result);
        }
        in.close();
    }
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
    public static void main (String [] args) throws IOException 
    {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        
        int len = Integer.parseInt(in.readLine());

        StringTokenizer s = new StringTokenizer(in.readLine());

        boolean isZero = false;
        boolean tooLong = false;
        long[] nums = new long[len];
        for(int i = 0; i < len; i++)
        {
            nums[i] = Long.parseLong(s.nextToken());
            if(nums[i] == 0)
            {
                isZero = true;
            }
        }
        long result = 1;
        
        for(int i = 0; i < len && !isZero; i++)
        {
            if(1000000000000000000L/nums[i] >= result)
            {
                result *= nums[i];
            }
            else
            {
                tooLong = true;
                break;
            }
        }

        if(isZero)
        {
            System.out.println(0);
        }
        else if(tooLong)
        {
            System.out.println(-1);
        }
        else
        {
            System.out.println(result);
        }
        in.close();
    }
} Main public static void main (String [] args) throws IOException 
    {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        
        int len = Integer.parseInt(in.readLine());

        StringTokenizer s = new StringTokenizer(in.readLine());

        boolean isZero = false;
        boolean tooLong = false;
        long[] nums = new long[len];
        for(int i = 0; i < len; i++)
        {
            nums[i] = Long.parseLong(s.nextToken());
            if(nums[i] == 0)
            {
                isZero = true;
            }
        }
        long result = 1;
        
        for(int i = 0; i < len && !isZero; i++)
        {
            if(1000000000000000000L/nums[i] >= result)
            {
                result *= nums[i];
            }
            else
            {
                tooLong = true;
                break;
            }
        }

        if(isZero)
        {
            System.out.println(0);
        }
        else if(tooLong)
        {
            System.out.println(-1);
        }
        else
        {
            System.out.println(result);
        }
        in.close();
    } main {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        
        int len = Integer.parseInt(in.readLine());

        StringTokenizer s = new StringTokenizer(in.readLine());

        boolean isZero = false;
        boolean tooLong = false;
        long[] nums = new long[len];
        for(int i = 0; i < len; i++)
        {
            nums[i] = Long.parseLong(s.nextToken());
            if(nums[i] == 0)
            {
                isZero = true;
            }
        }
        long result = 1;
        
        for(int i = 0; i < len && !isZero; i++)
        {
            if(1000000000000000000L/nums[i] >= result)
            {
                result *= nums[i];
            }
            else
            {
                tooLong = true;
                break;
            }
        }

        if(isZero)
        {
            System.out.println(0);
        }
        else if(tooLong)
        {
            System.out.println(-1);
        }
        else
        {
            System.out.println(result);
        }
        in.close();
    } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) int len = Integer.parseInt(in.readLine()); len Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in StringTokenizer s = new StringTokenizer(in.readLine()); s new StringTokenizer(in.readLine()) boolean isZero = false; isZero false boolean tooLong = false; tooLong false long[] nums = new long[len]; nums new long[len] len for(int i = 0; i < len; i++)
        {
            nums[i] = Long.parseLong(s.nextToken());
            if(nums[i] == 0)
            {
                isZero = true;
            }
        } int i = 0; int i = 0; i 0 i < len i len i++ i++ i {
            nums[i] = Long.parseLong(s.nextToken());
            if(nums[i] == 0)
            {
                isZero = true;
            }
        } {
            nums[i] = Long.parseLong(s.nextToken());
            if(nums[i] == 0)
            {
                isZero = true;
            }
        } nums[i] = Long.parseLong(s.nextToken()) nums[i] nums i Long.parseLong(s.nextToken()) Long.parseLong Long s.nextToken() s.nextToken s if(nums[i] == 0)
            {
                isZero = true;
            } nums[i] == 0 nums[i] nums i 0 {
                isZero = true;
            } isZero = true isZero true long result = 1; result 1 for(int i = 0; i < len && !isZero; i++)
        {
            if(1000000000000000000L/nums[i] >= result)
            {
                result *= nums[i];
            }
            else
            {
                tooLong = true;
                break;
            }
        } int i = 0; int i = 0; i 0 i < len && !isZero i < len i len !isZero isZero i++ i++ i {
            if(1000000000000000000L/nums[i] >= result)
            {
                result *= nums[i];
            }
            else
            {
                tooLong = true;
                break;
            }
        } {
            if(1000000000000000000L/nums[i] >= result)
            {
                result *= nums[i];
            }
            else
            {
                tooLong = true;
                break;
            }
        } if(1000000000000000000L/nums[i] >= result)
            {
                result *= nums[i];
            }
            else
            {
                tooLong = true;
                break;
            } 1000000000000000000L/nums[i] >= result 1000000000000000000L/nums[i] 1000000000000000000L nums[i] nums i result {
                result *= nums[i];
            } result *= nums[i] result nums[i] nums i {
                tooLong = true;
                break;
            } tooLong = true tooLong true break; if(isZero)
        {
            System.out.println(0);
        }
        else if(tooLong)
        {
            System.out.println(-1);
        }
        else
        {
            System.out.println(result);
        } isZero {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 if(tooLong)
        {
            System.out.println(-1);
        }
        else
        {
            System.out.println(result);
        } tooLong {
            System.out.println(-1);
        } System.out.println(-1) System.out.println System.out System System.out -1 1 {
            System.out.println(result);
        } System.out.println(result) System.out.println System.out System System.out result in.close() in.close in String [] args args public class Main {
    public static void main (String [] args) throws IOException 
    {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        
        int len = Integer.parseInt(in.readLine());

        StringTokenizer s = new StringTokenizer(in.readLine());

        boolean isZero = false;
        boolean tooLong = false;
        long[] nums = new long[len];
        for(int i = 0; i < len; i++)
        {
            nums[i] = Long.parseLong(s.nextToken());
            if(nums[i] == 0)
            {
                isZero = true;
            }
        }
        long result = 1;
        
        for(int i = 0; i < len && !isZero; i++)
        {
            if(1000000000000000000L/nums[i] >= result)
            {
                result *= nums[i];
            }
            else
            {
                tooLong = true;
                break;
            }
        }

        if(isZero)
        {
            System.out.println(0);
        }
        else if(tooLong)
        {
            System.out.println(-1);
        }
        else
        {
            System.out.println(result);
        }
        in.close();
    }
} public class Main {
    public static void main (String [] args) throws IOException 
    {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        
        int len = Integer.parseInt(in.readLine());

        StringTokenizer s = new StringTokenizer(in.readLine());

        boolean isZero = false;
        boolean tooLong = false;
        long[] nums = new long[len];
        for(int i = 0; i < len; i++)
        {
            nums[i] = Long.parseLong(s.nextToken());
            if(nums[i] == 0)
            {
                isZero = true;
            }
        }
        long result = 1;
        
        for(int i = 0; i < len && !isZero; i++)
        {
            if(1000000000000000000L/nums[i] >= result)
            {
                result *= nums[i];
            }
            else
            {
                tooLong = true;
                break;
            }
        }

        if(isZero)
        {
            System.out.println(0);
        }
        else if(tooLong)
        {
            System.out.println(-1);
        }
        else
        {
            System.out.println(result);
        }
        in.close();
    }
} Main
import java.util.*;
import java.io.*;
public class Main {
    public static void main (String [] args) throws IOException 
    {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        
        int len = Integer.parseInt(in.readLine());

        StringTokenizer s = new StringTokenizer(in.readLine());

        boolean isZero = false;
        boolean tooLong = false;
        long[] nums = new long[len];
        for(int i = 0; i < len; i++)
        {
            nums[i] = Long.parseLong(s.nextToken());
            if(nums[i] == 0)
            {
                isZero = true;
            }
        }
        long result = 1;
        
        for(int i = 0; i < len && !isZero; i++)
        {
            if(1000000000000000000L/nums[i] >= result)
            {
                result *= nums[i];
            }
            else
            {
                tooLong = true;
                break;
            }
        }

        if(isZero)
        {
            System.out.println(0);
        }
        else if(tooLong)
        {
            System.out.println(-1);
        }
        else
        {
            System.out.println(result);
        }
        in.close();
    }
}