#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int max(int a,int b){return a>b?a:b;}
int min(int a,int b){return a<b?a:b;} 
int main(void)
{
  int n,i;
  long a[10000],ans=1;
  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%ld",&a[i]);
  for(i=0;i<n;i++)
    ans*=a[i];
  if(ans>1000000000000000000)
    printf("-1");
  else
  printf("%ld",ans);
}
