#include <stdio.h>

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