
#include <stdio.h>

int main(){
    int n,i,c=1;
     int  a[100000];
    scanf("%d", &n);

 for(i=0; i<n; i++){
  scanf("%d",a[i]);
      c=c*a[i];}

if(a[1000]<=1000000000000000000){
   printf("%d",c);}
else printf("%d",-1);



return 0;
}