#include<stdio.h>
int main()
{
    int n, i, f = 0;
    long long int tmp = 1, INF = 1e+18, k = 1e6;
    long long int arr[100010];
    scanf("%d", &n);

    for (i=0; i<n; i++)
    {
        scanf("%lld", &arr[i]);
        if (arr[i] == 0)
        {
            arr[0] = 0;
            break ;
        }

    }

    for (i=0; i<n; i++)
    {
        if (arr[i] == 0)
        {
            tmp = 0;
            break;
        }

        if (arr[i] > INF/tmp)
            f = 1;
        tmp *= arr[i];
    }


    if (tmp > INF)
        printf ("-1\n");
    else
        printf("%lld\n", tmp);

    return 0;

}
