#include <stdio.h>
#define Bridge ((long long) 1e18)
 
int main(void){
  int n;
  long long a[100000];
  long long x = 1;
  
  scanf("%d", &n);
  
  for(int i = 0; i < n; i++){
    scanf("%lld", &a[i]);
  }
  
  for(int i = 0; i < n; i++){
    if(a[i] == 0){
      printf("0\n");
      return 0;
    }
  }
   
  for(int i = 0; i < n; i++){
    if(a[i] > Bridge / x){
      printf("-1\n");
      return 0;
    }
    
    x *= a[i];
  }
  
  printf("%lld\n", x);
  
  return 0;
}
