#include<stdio.h>
signed main(void)
{
  int N,f=0;
  long long x,y,L=1e18;
  x=scanf("%d",&N);
  while(~scanf("%lld",&y))
  {
    if(y==0)return puts("0"),0;
    else if(L/y<x)f=1;
    else x*=y;
  }
  if(f)x=-1;
  return printf("%lld\n",x),0;
}