#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]);
        a[i]?:puts("0\n"),exit(0);
    }
    uint_fast64_t p=1;
    for(uint_fast16_t i=0;i<n;i++)a[i]>UINT_FAST64_MAX/p?puts("-1\n"),exit(0):p*=a[i];
    p>1000000000000000000?puts("-1\n"):printf("%" PRIuFAST64 "\n",p);
    exit(0);
}