#include <stdio.h>

int main(){
    int x = 1;
    int n;
    scanf("%d",&n);

    int vet[n];

    for(int i = 0; i < n;++i){
        scanf("%d",&vet[i]);
        x = vet[i] * x;
    }
    if((x >> 31) & 1)
        printf("-1\n");
    else    
        printf("%d",x);
    return 0 ;

}