#include <stdio.h>
#include <math.h>

typedef long long ll;
typedef unsigned long long ull;

#define limit 1000000000000000000

int main(void) {
  int n;
  int c = 1;
  ll ret = 1;
  scanf("%d", &n);
  for(int i = 0;i < n;i++) {
    ll a;
    scanf("%lld", &a);
    c += (int)log10(a);
    ret *= a;
    if(c >= 18) {
      //ret = -1;
      break;
    }
  }
  printf("%lld\n", ret > limit ? -1 : ret);
  return 0;
}
