#include<stdio.h>
#include<stdlib.h>
#define INF 1000000000000000000
int main(){
  int unused __attribute__((unused));
  long long i, N, ans=1;
  long long *A;
  int flg = 0;
  unused = scanf("%lld", &N);
  A = malloc(sizeof(long long)*N);
  for(i=0; i<N; i++){
    unused = scanf("%lld", &A[i]);
    if(A[i]==0) ans = 0;
  }

  if(ans == 1){
    for(i=0; i<N; i++){
      ans *= A[i];
      if(ans > INF || ans < 0){
        ans = -1;
        break;
      }
    }
  }

  printf("%lld", ans);
  free(A);
  return 0;
}