You’re allowed to do whatever your publisher says you’re allowed to do. You’re not allowe dto do anything your publisher says you’re no allowed to do. It’s just this simple.
If you want to write YA, you need to read a lot of YA, and you need to know what publishers allow and what they don’t. This is what guidelines are for, and this is why you have to read a bunch of YA novels from different publishers.