#include<stdio.h>
#include<stdlib.h>
typedef long long ll;
#define max 1000000000000000000
int main(void)
{
  ll n,ans=1,ans_old;
  scanf("%lld",&n);
  ll data[n];
  for(int i=0;i<n;i++){
    scanf("%lld",&data[i]);
    if(data[i]==0){
      printf("0");
      return 0;
    }
  }
  
  for(int i=0;i<n;i++){
    if(ans<=(max/data[i])) ans*=data[i];
    else{
      printf("-1");
      return 0;
    }
  } 
  printf("%lld",ans);
  return 0;
}
