#include <iostream>
#include <iomanip>
#include <cstdint>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <algorithm>

int main(void)
{
    int64_t N;
    std::cin >> N;

    long double kMax = 1000000000000000000LL;

    long double ans = 1;
    for (int64_t i = 0; i < N; ++i) {
        long double A;
        std::cin >> A;
        ans *= A;
    }

    if (ans > kMax) {
        std::cout << -1 << std::endl;
        return 0;
    }

    std::cout << static_cast<int64_t>(ans) << std::endl;

    return 0;
}