#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdint.h>
#include<tgmath.h>
#include<stdbool.h>
#include<sys/queue.h>
#include<time.h>
#define ll long long
#define min(a, b) ((a) > (b) ? (b) : (a))
#define max(a, b) ((a) > (b) ? (a) : (b))

int cmp(const void *a, const void *b){
    //return *(int*)a - *(int*)b;
    if(*(ll*)a > *(ll*)b)return 1;
    else return -1;
}

const ll INF = 1000000000000000000ll;
ll n, a[100100];

main(){
    scanf("%lld", &n);
    for(int i=0; i<n; i++){
        scanf("%lld", &a[i]);
    }
    qsort(a, n, sizeof(ll), cmp);
    __uint128_t ans = 1;
    for(int i=0; i<n; i++){
        ans *= a[i];
        if(ans > INF){
            puts("-1");
            return 0;
        }
    }
    printf("%lld\n", ans);
}
