#include <stdio.h>
#include <stdint.h>
#include <math.h>

int main()
{
    int64_t N;
    scanf("%ld", &N);
    int64_t A = 1, tmp;
    for (int64_t i = 0; i < N; i++)
    {
        scanf("%ld", &tmp);
        A *= tmp;
    }
    if (A > 1000000000000000000)
    {
        A = -1;
    }
    printf("%ld", A);
    return 0;
}