#include <stdio.h>
#include <limits.h>

int main(){
  int n;  scanf("%d ", &n);
  long ans = 1, preans = 1;
  
  int over = 0, zero = 0;
  for(int i=0; i<n; i++){
    long a;  scanf("%ld", &a);
    if(a > LONG_MAX/ans)  over = 1;
    if(over == 0)  ans = ans * a;
    if(a == 0)  zero = 1;
  }
  //  printf("over : %d\n", over);
  if(zero){
    ans = 0;
  }else if(over){
    ans = -1;
  }else if(ans > 1000000000000000000){
    ans = -1;
  }
  
  printf("%ld\n", ans);
  
  return 0;
}
