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