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

int main()
{
  long long n, ans = 1, l = 1e18;
  cin >> n;
  for(int i = 0; i < n; ++i)
  {
    long long temp;
    cin >> temp;
    if(temp == 0){
      cout << 0 << endl;
      return 0;
    }
    if(ans < 0 || l/ans < temp)
    {
      ans = -1;
    }
    else ans *= temp;
  }
  
  cout << ans << endl;
}