/*
 * FileName:     B
 * CreatedDate:  2020-05-31 21:06:26 +0900
 * LastModified: 2020-05-31 21:11:27 +0900
 */

#include <stdio.h>
#include <stdlib.h>
#define max 1000000000000000000
int main(void){
    int n;scanf("%d",&n);
    long long int *a = malloc(n*sizeof(long long int));
    long long int all=1;
    for(int i=0;i<n;i++){
        scanf("%lld",a+i);
        if(all<max){
            all*=a[i];
        }
        if(a[i]==0){
            printf("0\n");
            free(a);
            return 0;
        }
    }
    if(all>max){
        printf("-1\n");
        free(a);
        return 0;
    }
    printf("%lld\n",all);
    free(a);
    return 0;
}
