int main(){
  int num, i, j;
  int cnt = 0;
  int minus = 0;
  int *a;
  long int ans = 1;
  
  scanf("%d", &num);
  a = (int *)malloc(sizeof(int)*num);
  
  for(i = 0; i < num; i++){
    scanf("%d ", &a[i]);
    while(a[i] >= 10) {
      a[i] /= 10;
      cnt++;
    }
    if(a[i] < 0){
      minus++;
    }
  }
  
  if(minus%2 == 1){
    printf("%d", -1);
  }
  else if(cnt > 18) {
    printf("%d", -1);
  }
  else
  {
    for(i = 0; i < num ; i++){
      ans *= a[i];
    }
    ans *= pow(10, cnt);
    printf("%ld", ans);
  }
  
  return 0;
}