#include <stdio.h>
int main(void){
    // Your code here!
    long n,a[100000],j=1;
    scanf("%ld",&n);
    for(int i=0;i<n;i++)scanf("%ld",&a[i]);
    for(int i=0;i<n;i++){
        j=a[i]*j;
        
    }
    if(j>1000000000000000000)printf("-1\n");
    else printf("%ld\n",j);
    return 0;
}