#include <stdio.h>

int main(){
    int N;
    int A[100000];
    unsigned long int num=1;
    scanf("%d\n",&N);
    for (int i=0; i<N; i++) {
        scanf("%d",&A[i]);
        num=A[i]*num;
    }
    if (num<=1000000000000000000) {
        printf("%lo",num);
    }
    if (num>1000000000000000000) {
        printf("-1");
    }
}