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

    for (i=0; i<n; i++)
    {
        scanf("%lld", &k);

        if (k > INF/tmp)
        {
            f = 1;
            break;
        }

        tmp *= k;

        if (tmp == 0)
            break;
    }

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

    return 0;

}
