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

int main(void)
{
    unsigned long long int N, ans = 1, zero = 0;
    int era = -1;
    unsigned long long int A[100000] = {0};
    scanf("%llu", &N);
    for (unsigned long long int i = 0; i < N; i++)
    {
        scanf("%llu", &A[i]);
        if (A[i] == 0)
        {
            printf("%llu", zero);
            exit(0);
        }
        
    }

    for (unsigned long long int i = 0; i < N; i++)
    {
        ans *= A[i];
        if (ans > 1000000000000000000)
        {
            printf("%d", era);
            exit(0);
        }
        
    }

    printf("%llu", ans);
    
    
    return 0;
}