#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define ll long long

int n;
ll a;

int main(){
  ll sum=1;
  int flag=1;
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%lld",&a);
    if(a==0){
      sum*=0;
      break;}
    if(1.0*log(sum)+1.0*log(a)>18.0*log(10)){
    flag=0; continue;}
    sum *= a;
    if(sum>1000000000000000000){
    sum=-1; break;}
  }
  
  if(flag==0 && sum!=0){
    sum=-1;}
  printf("%lld\n",sum);
  
  return 0;
}
