#include<stdio.h>
#include<stdlib.h>
#include<math.h>

typedef long long ll;
typedef const void cv;
int upll(cv *a, cv *b) { 
  return *(ll *)a < *(ll *)b ? -1 : *(ll *)a > *(ll *)b ? 1 : 0;
}


int main(void){

	ll a[100000],b,result=1;
    int n,i;
    scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%lld",&a[i]);
  }
  qsort(a,n,sizeof(ll),upll);
  for(i=0;i<n;i++){
  if(powl(10,18)/result<a[i]){
    result = -1;
    break;
  }else if(a[i]==0){
    result = 0;
    break;
  }
    result *= a[i];
  }
    printf("%lld", result);
    
    return 0;
}