#include<stdio.h>
#include<limits.h>

int main(void){
  int i, n;
  scanf("%d", &n);

  int num;
  long long cul = 1;
  long long x = 1000000000000000000;

  for(i=0;i<n;i++){
    scanf("%d", &num);
    cul *= num;
  }

  if( cul < x ) printf("-1\n");
  else printf("%ld\n", cul);

  return 0;
}