This nitrogen-containing heterocyclic compound or pharmaceutically acceptable salt thereof is, for example, useful as a prophylactic and/or therapeutic agent and the like for dermatosis and the like. The present invention provides a heterocyclic compound represented by general formula (I) or a pharmaceutically acceptable salt and the like thereof that is, for example, useful as a prophylactic and/or therapeutic agent for dermatosis and the like. [In the formula, for example, XA is CH or the like, R1 is a cycloalkyl or the like optionally having substitution groups, L is a bond or the like, YA is -NH- or the like, R2 is a hydrogen atom or the like, R3A is the formula (R3A-1) (where R3 is a hydroxyl, or the like), and R4A is the formula (R4A-1) (where R4 and R5 are the same or different hydrogen atoms, or the like).]