#include<stdio.h>
int main(void){
  int num,i;
  int sum=1;
  int N[100000];
  
  scanf("%d\n",&num);
  for(i=0;i<num;i++){
    scanf("%d ",&N[i]);
    sum*=N[i];
  }
  if(sum>1000000000000000000){
    printf("%d\n",-1);
  }else{
    printf("%d\n",sum);
  }
  return 0;
}