#include <cstdio>

int main() {
    int n;
    unsigned long long int a, s = 1;
    long double d = 1.0L;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%lld", &a);
        s *= a;
        d *= a;
    }
    if (d > 1000000000000000000) printf("-1\n");
    else printf("%lld\n", s);
    return 0;
}