#include<stdio.h>
 
int main() {
    long n;
    scanf("%ld",&n);
    long a[1000001];
    long p=1;
    for (long i=0;i<n;i++) {
        scanf("%ld",&a[i]);
    }
  	for (long i=0;i<n;i++) {
        p=p*a[i];
    }
    if (p>1000000000000000000) printf("-1");
    else printf("%ld\n",p);
    return 0;
}