#include<stdio.h>
int main(){
  int n;
  scanf("%d",&n);
  long long int a[100000];
  long long int result=1;
  for(int i=0;i<n;i++){
    scanf("%lld",&a[i]);
    result=result*a[i];
    //printf("%d回目　%lld\n",i,result);
    if(result>1000000000000000000 || a[i]>1000000000000000000){
      printf("-1\n");
      return 0;
  }
  }
 
    printf("%lld\n",result);
  return 0;
}