#include <stdio.h>
#include <stdint.h>
#include <math.h>
#include <stdlib.h>
#include <errno.h>

int main()
{
    int64_t N;
    scanf("%ld", &N);
    int64_t A[N],result=1;
    char *endptr;
    for (int64_t i = 0; i < N; i++)
    {
        char tmp[20];
        scanf("%s",tmp);
        A[i]=strtol(tmp,&endptr,0);
        if (A[i]==0){
            printf("0");
            return 0;
        }
    }
    for (int64_t i = 0; i < N; i++){
        result *=A[i];
        if(result > 1000000000000000000){
            result=-1;
            break;
        }
    }
    printf("%ld", result);
    return 0;
}