#include<stdio.h>
int main()
{

    unsigned long long a = 1, tmp, n, f = 0;
    scanf("%llu", &n);
    while (n--)
    {
        scanf("%llu", &tmp);
        a *= tmp;
        if (a > 1000000000000000000){
            f = 1;
            a = 1;
        }
    }
    if ( a == 0 )
        printf("0\n");
    else if (a > 1000000000000000000 || f == 1)
        printf("-1\n");
    else {
        printf("%llu\n", a);
    }
    return 0;

}
