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