#include <stdio.h>

int main()
{
    int N, i;
    scanf("%d",&N);

    unsigned long long int A[N], mul=1;

    for(i=0; i<N; i++)
    {
        scanf("%lld",&A[i]);
        mul = mul*A[i];
    }
    if(mul >= 0 && mul <= 1000000000000000000)
    {
        printf("%lld\n",mul);
    }
    else
        printf("-1\n");

    return 0;
}
