There are exceptions at both ends of the spectrum, but it's important to focus on the debut novels when assessing wordcount for unpublished writers. Once an author has been successful, publishers are more willing to take risks. It's also important to make sure the book is actually considered YA, and not MG.
I can't think of a contemporary YA book (last 5 years) with a wordcount under 20,000, I actually can't think of one under 35,000 words. I'd welcome some examples if anyone knows of some - last 5 years or so, word counts under 30,000, 20,000 - to add to my understanding of what the market is doing.
While you have to write the book that need swriting, when you get to the shopping it end of things, it's always good to know what the market is doing.
And while the difference bewteen MG and YA may be a small distinction for the readers out there, when querying, it is an important distinction.
~suki