#include<stdio.h>

int main() {
   int N,sum;
   sum = 1;
   scanf("%d",&N);
   int A[N];
   for(int i = 0; i < N; i++) {
      scanf("%d", &A[i]);
   }
   for(int i = 0; i < N; i++) {
      sum = sum * A[i];
   }
   if(sum < 1000000000000000000) {
      printf("%d\n",sum);
   } else {
      printf("%d\n",-1);
   }
}
