If the novel specifies that it is tailored for the mature YA audience, swearing can be featured, but most YA books won’t.