#include<stdio.h>

int main()
{
    int n, i;
    scanf("%d", &n);
    unsigned long long int a[n], product = 1;
    for(i = 0; i < n; i++)
    {
        scanf("%llu", &a[i]);
        product *= a[i];
    }
    if(product > 1000000000000000000)
    {
        printf("-1");
        return 0;
    }
    printf("%llu", product);
    return 0;
}
