#include <stdio.h>

typedef long long ll;
typedef unsigned long long ull;

int main(void) {
  int n;
  ll ret = 1;
  scanf("%d", &n);
  for(int i = 0;i < n;i++) {
    ll a;
    scanf("%lld", &a);
    ret *= a;
  }
  printf("%lld\n", (ull)ret > (ull)1e18 ? -1 : ret);
  return 0;
}
