#include <stdio.h>
int main(void){
    int n,a;
    unsigned long ans=1;
    scanf("%d",&n);
    for(int i=0; i<n; i++){
        scanf("%d",&a);
        ans*=a;
    }
    if(ans>1000000000000000000)
        printf("-1");
    else
        printf("%ld",ans);
}
