#include "stdio.h"
#define Max 1000000000000000000

int main(void)
{
    long int su;
    scanf("%ld",&su);

    long int A[su];
    long int kei=1;
    long int i;
    int no = -1;

    for(i=0;i<su;i++)
    {
        scanf("%ld",&A[i]);

    }
    for(i=0;i<su;i++)
    {
        kei = kei*A[i];
    }
    if(kei > Max)
    {
        printf("-1");
    }
    else
    {
        printf("%ld",kei);
    }
    
}