#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define ll long long

int main(void)
{
    ll a, ans = 1;
    int n, i;
    ll lim = pow(10, 18);
    scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        scanf("%lld", &a);
        ans *= a;
    }
    if (ans > lim)
    {
        ans = -1;
    }
    printf("%lld\n", ans);
    return 0;
}