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