#include <stdio.h>

int main(void) {
  int n;

  scanf("%u", &n);

  long long unsigned int max = 1;
  for (int i = 0; i < 18; i++) max *= 10;

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