#include <stdio.h>
int main(void){
  int i, a, b, c;
  
  scanf("%d", &i);
  
  a = 0;
  while(a != i){
    scanf("%d", &b);
    c = c*b;
    
    i++;
  }
  
  if(c > 1000000000000000000){
    c = -1;
  }
  
  printf("%d", c);
  
  return 0;
}