#include<stdio.h>
int main()
{
    int n, f = 1;
    unsigned long long a = 1, tmp;
    scanf("%d", &n);
    while (n--)
    {
        scanf("%llu", &tmp);
        a *= tmp;
    }
    if (a > 1000000000000000000)
        printf("-1\n");
    else {
        printf("%llu\n", a);
    }
    return 0;
}
