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