#include <stdio.h>
int main() {
  int count, a;
 	long long multiply = 1;
   scanf("%d", &count);
  for (int i = 0; i < count; i++) {
    scanf("%d", &a);
    multiply *= a;
  }
  if (multiply > 1000000000000000000) {
    printf("-1");
  }
  else {
    printf("%lli", multiply);
  }
  return 0;
}