#include <stdio.h>

int main()
{
    int n;
    scanf("%d", &n);

    int i;
    long long int pro = 1;

    for(i = 1; i <= n; i++)
    {
        long long int x;
        scanf("%lld", &x);

        if(pro*x > 1000000000000000000)
            pro = -1;

        if(pro != -1 || x == 0)
            pro = pro * x;
    }

    printf("%lld\n", pro);

    return 0;
}
