#include<stdio.h>
#include<math.h>
int main()
{
    long long int A;
    int n;
    long long int mul=1;

    scanf("%d",&n);

    while(n--)
    {
        scanf("%lld",&A);

        mul=mul*A;
    }


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

    return 0;
}
