#include <stdio.h>
int main(void)
{
    long long int N, sum = 1, a;
    scanf("%lld", &N);
    while(N > 0)
    {
        scanf("%lld", &a);
        sum = sum * a;
        N--;
    }
    if(sum <= 1000000000000000000)
        printf("%lld\n", sum);
    else
        printf("-1\n");


    return 0;
}
