That would be considered illegal under IPC interpretation here. You're not allowed to use a combination going from horizontal to vertical that is also the vent.
I see that it apparently is ok for the UPC, which often has what one could interpret to be "stricter" codes.
Just goes to show again that having multiple codes is complete B.S. and we all need to get together somehow to only have one book for the whole U.S.