#include <stdio.h>
#include <math.h>

int main(){
  long long x=1, y;
  int s;
  scanf("%d", &s);
  for(int i=0; i<s; i++){
    scanf("%lld", &y);
    x*=y;
    if(x >= 1000000000000000000){
      printf("-1\n");
      retrun 0;
    }
  }
  printf("%lld\n", x);
}