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