#include<stdio.h>
int main()
{
    unsigned long n;
    int loop;
    unsigned long long ans=1;
    // 整数の入力
    scanf("%d", &loop);
    while (loop >= 1)
    {
        scanf("%lu", &n);
        ans = ans * n;
        if (n == 0)
        {
            break;
        }

        loop--;
    }
    // 出力
    if (ans > 1000000000000000000)
    {
        printf("-1");
    }
    else
    {
        printf("%llu",ans);
    }
    return 0;
}