#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

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