//B - Multiplication 2
//Hiia
#include <stdio.h>

int main(){
  long long int n, i, a, b=1,judge=0;
	scanf("%lld", &n);
  for(i=0;i<n;i++){
    scanf("%lld", &a);
    b *= a;
    if(b>1000000000000000000){
      b=1;
      judge++;
      //printf("%lld :)\n", b);
    }
  }

  if(b==0){
    printf("0\n");
    return 0;
  }

  if(judge>=1){
    printf("-1\n");
    return 0;
  }
  
  if(judge==0){ //ichiou tsukuru
    printf("%lld\n", b);
  }
  return 0;
}
