#include<stdio.h>

int main(){

int i = 1;
int n;
int sum = 1;

scanf("%d",&n);

for(i=1;i<=n;i++){
int a;
scanf("%d",&a);

sum *= a;
}
if(sum>1000000000000000000){
printf("-1");
}else{
printf("%d",sum);
}

return 0;
}