#include<stdio.h>

int main(void)
{
	unsigned long long int a, b, c = 1, d = 0;
	int i;

	scanf("%lld", &a);

	for (i = 0; i < a; i++) {
		scanf("%lld", &b);
		if (1000000000000000000　/ b < c) {
			d = 1;
			
		}
		c = c * b;	
	}

    if (d == 0 || c == 0) {
	printf("%lld", c);
    }
  
  else {
    printf ("-1");
  }
  
      
	return 0;
}