#include <stdlib.h>
#include <stdio.h>

int main(){
    int n = 0;
    scanf("%d", &n);
    unsigned long long int max = 1e18;
    unsigned long long int ans = 1;
    int zero = 0;
    int *arr = malloc(n*sizeof(int));
    for(int i = 0; i < n; i++){
        scanf("%d", (arr+i));
    }

    for(int i = 0; i < n; i++){
        ans *= arr[i];
    }
    if(ans > max){
       ans = -1;
    }
    printf("%llu\n", ans);

    return 0;
}