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