#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    long long int ans = 1, tmp;
    int n, i,f = 0;
    scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        scanf("%lld", &tmp);
        ans *= tmp;
        if (tmp == 0)
        {
            printf("0");
            return (0);
        }
        if (10000000000000000000 / ans < tmp)
        {
            f = 1;
        }
        if (ans > 1000000000000000000 || ans < 0)
        {
            f = 1;
        }
    }
    if (f == 1)
        printf("-1");
    else
    printf("%lld", ans);
   return (0);
}
