#include<stdio.h>

int main() {
  
  unsigned long long loop, v, acc = 1;
  
  scanf("%lld", &loop);
  
  for(int i = 0; i < loop; ++i) {
    
    scanf("%lld", &v);
    if (v == 0) {
      printf("0\n");
      return 0;
    }
    
    if (acc != -1) {
      acc *= v;
      if (acc > 1000000000000000000ULL) {
        acc = -1;
      }
    }
    
  }
  printf("%lld\n", acc);  
  return 0;
  
}
