#include<stdio.h>
int main(void){
 int n;
 int ans = 1;
 scanf("%d",&n);
 for(int i = 1; i <= n; i++){
   int num;
   scanf("%d",&num);
   ans*=num;
 }
  if(ans>1000000000000000000){
    ans = -1;
  }
  printf("%d\n",ans);
  return 0;
}