#include<stdio.h>
int main(void){
  int i,j,a[INT_MAX],ans=1;
  scanf("%d",&i);
  for(j=0;j<i;j++){
    scanf("%d",a[j]);
  }
  for(j=0;j<i;j++){
    ans*=a[j];
  }
  ans = (ans > 1000000000000000000)? = -1 : ans;
  printf("%d",ans);
return 0;
}  