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

int main(void)
{
    int N;
    long unsigned int *A;
    long unsigned int ans = 1;
    int c;
    scanf("%d", &N);
    A = (long unsigned int *)malloc(sizeof(long unsigned int) * N);
    for (c = 0; c < N; ++c)
    {
        scanf("%ld", A + c);
    }
    for (c = 0; c < N; ++c)
    {
        if (A[c] > 1e+18)
        {
            printf("-1");
            return 0;
        }
        ans *= A[c];
        if (ans > 1e+18)
        {
            printf("-1");
            return 0;
        }
    }
    printf("%ld", ans);
    return 0;
}