#include<stdio.h>
#define LIMIT 1000000000000000000 
int main(void){
  int n, i;
  unsigned long long int a[100000]={0};
  unsigned long long int result = 1;
  scanf("%d",&n);
  for(i=0; i<n; i++){
    scanf("%lld", &a[i]);
    if(a[i] == 0){
      printf("0\n");
      return 0;
    }
  }
  for(i=0; i<n; i++){
    result *= a[i];
    if( result > LIMIT){
      printf("-1\n");
      return 0;
    }
  }
  printf("%lld\n",result);
  return 0;
}
