#include <stdio.h>
#define N 1000000000000000000

int main(void)
{
    long long n, a, ans = 1;

    scanf("%lld", &n);

    while(n--)
    {
        scanf("%lld", &a);

        if(a == 0)
            ans = 0;

        if(ans <= N)
            ans*=a;
    }

    if(ans <= N)
        printf("%lld", ans);
    else
        printf("-1");

    return 0;
}
