#include<stdio.h>
int main()
{
    int n, i, f = 0;
    long long int arr[100010], tmp = 1;
    scanf("%d", &n);
    for (i=0; i<n; i++)
    {
        scanf("%lld", &arr[i]);
        if (arr[i] > 1e18/tmp)
            f = 1;
        tmp *= arr[i];
        if (tmp > 1e18){
            f = 1;
            tmp = 1;
        }
    }
    if (tmp == 0)
        printf("0\n");
    else if (f == 1)
        printf("-1\n");
    else
        printf("%lld\n", tmp);

    return 0;

}
