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