#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main(void)
{
    int N;
    long long int *A;
    long long int ans = 1;
    double dA;
    double dans;
    char temp[30];
    char temp2[30];
    int c;
    scanf("%d", &N);
    A = (long long int *)malloc(sizeof(long long int) * N);
    for (c = 0; c < N; ++c)
    {
        scanf("%lld", A + c);
        if (A[c] == 0)
        {
            printf("0");
            return 0;
        }
    }
    for (c = 0; c < N; ++c)
    {
        sprintf(temp, "%lld", A[c]);
        sprintf(temp2, "%lld", ans);
        sscanf(temp, "%lf", &dA);
        sscanf(temp2, "%lf", &dans);
        if (log10(dA * dans) > 19)
        {
            printf("-1");
            return 0;
        }
        ans *= A[c];
        if (ans > (long long)1e+18)
        {
            printf("-1");
            return 0;
        }
    }
    printf("%lld", ans);
    return 0;
}