#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define PI acos(-1)
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;

int main(void) {
  /* 標準入力フラグ */
  int   scan;

  /* 数入力 */
  ull    answer;
  ull    n;
  ull    *a;

  scan = scanf("%llu", &n);
  a = (ull *)malloc(sizeof(ull) * n);
  for (ull i = 0; i < n; i++) {
    scan = scanf("%llu", &a[i]);
  }  
 
  /* プログラムを書く */
  answer = 1;
  for (ull k = 0; k < n; k++) {
    answer = answer * a[k];
    if (answer > (ull)pow(10, 18)) {
      printf("-1");
      return (0);
    }
  }

  printf("%llu\n", answer);



  return (0);
}
