#include <stdio.h>
#define max 1000000000000000000
int main()
{
  long long int a[100000];
  int N;
  int i;
  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 > max) || (result < 0)){
      printf("-1\n");
      return 0;
    }
  }
  printf("%lld\n", result);
  return 0;
}