#include <stdio.h>

int main(void) {
  int n,p;
  p = -1;
  long long k=1,number[100000]={};
  scanf("%d",&n );
  for (int i=0;i<n;i++ ) {
    scanf("%lld",&number[i]);
    if (number[i]>1000000000000000000) {
      printf("%d\n",p );
      return (0);
    }
    k *=number[i];
  }
  if (k>1000000000000000000) {
    printf("%d\n",p);
    return (0);
  }
  printf("%lld\n",k );
  return (0);
}
