#include<stdio.h>
typedef long long ll;
ll max=1000000000000000000;
int main(void)
{
  int n;
  ll a[200000];
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%lld",&a[i]);
    if(a[i]==0){
      puts("0");
      return 0;
    }
  }
  ll sum=1;
  int start=0;
  while(start<n){
    sum*=a[start++];
    if(sum>max){
      puts("-1");
      return 0;
    }
  }
  printf("%lld\n",sum);
  return 0;
}
