#include<stdio.h> 
int main(void){
  int n, i;
  scanf("%d", &n);
  long int a[n], A = 1;
  for(i=0; i<n; i++){
    scanf("%ld", &a[i]);
    A *= a[i];
  }
  if(A<=1000000000000000000){
    printf("%ld", A);
  }else{
    printf("%d",-1);
  }
}