#include <stdio.h>
int main(void){
    // Your code here!
    unsigned long int n;
    unsigned long int a;
    unsigned long int res = 1;
    scanf("%ld", &n);
    
    int i;
    for(i = 0; i < n; i++){
        scanf("%ld ", &a);
        if(a == 0){
            printf("0");
            return 0;;
        }
        if(a != 1){
            if(res < 500000000000000000){
                res = res * a;
            }else{
                printf("-1");
                return 0;
            }
            //if(res > 1000000000000000000){
            //    printf("-1");
            //    return 0;
            //}
        }
    }
    printf("%ld", res);
    return 0;