#include<stdio.h>

int main(void){
  int n;
  scanf("%d",&n);

  unsigned long long a[n] , ans = 1;

  for(int i = 0;i < n;i ++){
  scanf("%lld",&a[i]);
  if(a[i] == 0){
    ans = 0;
    n = 0;
  }
  }

  for(int i = 0;i < n;i ++){
    ans *= a[i];
    if(ans > 1000000000000000000){
      ans = -1;
      i += n;
    }
  }


  printf("%lld\n",ans);

  return 0;


}
