#include <stdio.h>
 
int main(){
    int c,i;
 
    scanf("%d",&c);
       long long int a[c],m=1;
    for(i=0;i<c;i++){
    scanf("%lld ",&a[i]);
    m=m*a[i];}
    if(m<=1000000000000000000)
    printf("%lld\n",m);
    else
    {
        puts("-1");
    }
    
    return 0;
}    