#include<stdio.h>
int main(){
int N;

scanf ("%d",&N);
int A;
unsigned long long int B = 1;

for (int i = 0; i < N; i++ ){
	 scanf ("%d", &A);

B = A*B; 
}
if (B > 1000000000000000000) {
	printf ("-1\n");
}
else if (B == 1000000000000000000){
	printf ("1000000000000000000\n");
}
else {  printf ("%d\n", B); }

    return 0;
}