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

int main(){
    int N,a;
    unsigned long long int kekka=1;
        scanf("%d",&N);
    int *A;
    A = (int*)malloc(sizeof(int)*N);
    int i;
    for(i=0;i<N-1;i++){
        scanf("%d ",&a);
        kekka *=a;
    }
        scanf("%d",&a);
        kekka *=a;
        //   1000000000000000000
        /////9223372036854775807
    if(kekka<=1000000000000000000)
        printf("%llu\n",kekka);
    else
        printf("-1");

    return 0;
}