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