#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int main() {
    long long n, ans = 1;
    scanf("%lld", &n);
    long long a[100000], b = 1000000000000000000;
    for (long long i = 1; i <= n; i++) { scanf("%lld", &a[i]); }

    for (int i = 1; i <= n; i++) {
        if (a[i] == 0) { printf("0"); return 0; }
    }

    for (long long i = 1; i <= n; i++) {
        if (b / ans < a[i]) { printf("-1"); return 0; }

        ans *= a[i];
    }

    printf("%lld", ans);
}