#include<stdio.h>

int main(void) {
  int n;
  unsigned long ans=1, t, _tmp;
  scanf("%d", &n);
  int i;
  _Bool ov = 0;
  for(i=0; i<n; i++) {
    scanf("%lu", &t);
    if(t == 0) {
      printf("0\n");
      return 0;
    }
    _tmp = ans;
    ans = ans * t;
    if(_tmp > ans || ans > 1000000000000000000) {
      ov = 1;
    }
  }
  if (ans > 1000000000000000000 || ov == 1) {
    printf("-1\n");
  }
  else {
    printf("%lu\n", ans);
  }
  return 0;
}