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

  free(A);
  return 0;
}