#include <stdio.h>
 
int aiueo(int,int);
 
int main(){
  int N;
  int temp;
  int A[999999] = {};
  if(scanf("%d",&N)){};
  for (int i=0;i <= N;i++){
    if(scanf("%d",&A[i])){};
  }
  for (int i=0;i <= N;i++){
    temp *= A[i];
  }
  if (temp >= aiueo(10,18)){
    printf("-1");
  }else{
    printf("%d",temp);
  }
}
 
int aiueo(int x,int y){
  int temp;
  for (int i=0;i <= y;i++){
    temp *= x;
  }
  return temp;