#include<bits/stdc++.h>
using namespace std;

int main()
{
  unsigned long long int x,mul=1;
  int n;
  cin>>n;
  unsigned  long long int a[n];
  for( int i=0;i<n;i++)
  {cin>>a[i];
    mul*=a[i];
  }
  
 x=pow(10,18);

 if(mul>x)
  {
    cout<<-1;
}else
{
cout<<mul;
}
return 0;}