#include <stdio.h>

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

  }
}
