#include<stdio.h>

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

    scanf("%d",&n);

    for(i=1;i<=n;i++)
    {
         scanf("%lld",&A);
        mul=mul*A;
    }

    if(mul>1000000000000000000)
        printf("-1");
    else
        printf("%lld\n",mul);
    return 0;
}
