#include<stdio.h>

int main()
{
    long long int A,mul=1;
    int n;

    scanf("%d",&n);
    while(n--)
    {
        scanf("%lld",&A);
        mul=mul*A;
    }
    if(mul>1000000000000000000)
        printf("-1");
    else
        printf("%lld\n",mul);
    return 0;
}
