#include <stdio.h>

#define rep(i, n) for(int i=0; i<(n); ++i)
#define MAX 9223372036854775807
#define ARR_MAX 288199999999999999

void debug(char * string, long long int target) {
  printf("%s", string);
  printf("%lld", target);
  printf("%c", '\n');
}

int main() {
  int N;

  scanf("%d", &N);

  if (N < 2) {
    return 1;
  }
  if (N > 100000) {
    return 1;
  }

  long long int ans = 1;
  short ng = 0;

  rep(i, N) {
    long long int A;
    scanf("%lld", &A);
    if (A == 0) {
      printf("0\n");
      return 0;
    }
    if (ng == 1 || A > (10e18 / ans)) {
      ng = 1;
      return 0;
    }
    ans *= A;
  }

  if (ng == 1) {
    printf("-1\n");
  } else {
    printf("%lld\n", ans);
  }
  return 0;
}
