#include <stdio.h>

int main(void) {
  int n;
  scanf("%d", &n);

  long long int ans = 1;
  for (int i = 0; i < n; i++) {
    long long int num;
    scanf("%lld", &num);
    
    if (num == 0) {
      printf("0");
      return 0;
    }
    
    if (ans >= 0 && ans <= 1000000000000000000 / num)
      ans *= num;
    else
      ans = -1;
  }
  
  printf("%lld", ans);
  
  return 0;
}
