#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>
int main(void){
    uint_fast16_t n;
    scanf("%" SCNuFAST16 "",&n);
    uint_fast64_t a[n];
    for(uint_fast16_t i=0;i<n;i++){
        scanf("%" SCNuFAST64 "",&a[i]);
        if(!a[i]){puts("0");exit(0);}
    }
    uint_fast64_t p=1;
    for(uint_fast16_t i=0;i<n;i++)if(a[i]>UINT_FAST64_MAX/p){puts("-1\n");exit(0);}else p*=a[i];
    if(p>1000000000000000000)puts("-1");
    else printf("%" PRIuFAST64 "\n",p);
    exit(0);
}