#include<stdio.h>
#include<math.h>

int N;
long ans=1;
int main()
{
scanf("%d",&N);

long a[N+1]; 

for (int i = 0; i < N; i++)
{
  scanf("%ld",&a[i]);
  ans *= a[i];
  if(ans > (long)pow(10,18))
  {

    ans = -1;
    break;
  }
  
}

printf("%ld",ans);



return 0;

}