#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MOD 1000000007
#define INF 1000000000000000000
#define PI 3.14159265359
#define ull unsigned long long
#define MYPOW_t int

ull compare_smallorder(const void *a, const void *b){return *(ull*)a - *(ull*)b;}

int main(){
    ull i,n,a[100002]={},ans=1;
    scanf("%lld",&n);
    for (i=0; i<n; i++) scanf("%lld",&a[i]);
    qsort(a, n, sizeof(a[0]), compare_smallorder);
    for (i=0; i<n; i++) {
        if (ans==0) {
            printf("%d",0);
            return 0;
        }
        if (a[i]>=INF/ans) {
            printf("%d",-1);
            return 0;
        }
        ans*=a[i];
    }
    printf("%lld",ans);
    return 0;
}


