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

ll pivot(ll *a, ll i, ll j)
{
    ll k = i + 1;
    while (k <= j && a[i] == a[k])
        k++;
    if (k > j)
        return -1;
    if (a[i] >= a[k])
        return i;
    return k;
}
ll partition(ll *a, ll i, ll j, ll x)
{
    ll l = i, r = j;
    while (l <= r)
    {
        while (l <= j && a[l] < x)
            l++;
        while (r >= i && a[r] >= x)
            r--;

        if (l > r)
            break;
        ll t = a[l];
        a[l] = a[r];
        a[r] = t;
        l++;
        r--;
    }
    return l;
}

void quickSort(ll *a, ll i, ll j)
{
    if (i == j)
        return;
    ll p = pivot(a, i, j);
    if (p != -1)
    {
        ll k = partition(a, i, j, a[p]);
        quickSort(a, i, k - 1);
        quickSort(a, k, j);
    }
}

int main(void)
{
    ll a, ans = 1;
    ll ary[100002];
    int n, i;
    ll lim = pow(10, 18);
    scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        scanf("%lld", &ary[i]);
    }
    quickSort(ary, 0, n - 1);
    for (i = 0; i < n; i++)
    {
        if (ary[0] == 0)
        {
            ans = 0;
            break;
        }
        ans *= ary[i];

        if (ans > lim)
        {
            ans = -1;
            break;
        }
    }
    printf("%lld\n", ans);
    return 0;
}