#include<stdio.h>
int main(void)
{
    int n,i;
    unsigned long long int m=1,a[100000];
    scanf("%d",&n);
    for(i=1;i<=n;i++)
        scanf("%lld",&a[i]);
    for(i=1;i<=n;i++){
        m=m*a[i];
    }
    if(m>(1000000000000000000))
        m=-1;
    printf("%lld\n",m);
    return 0;
}