First off, this is understandable. For a moment, put it into a human perspective. Baby one does tend to resent baby two, for a while, don't they? Your Yorkie has had your undivided attention for over a year now and suddenly, in comes this little bundle of joy and everybody is oohing and aaahing over her. He feels completely shut out (even if he's not). You will have to reinforce him big time.
First purchase, after new puppy - NEW CRATE. Puppy needs to know how far she can go with Yorkie. And if he won't sort her out (kindly) when she oversteps the mark with him, you must. And a crate is an ideal aid. Most adults, and your lad is now a young adult, won't attack a puppy and in fact, can be, and are often, frightened about them because they don't know how to deal with them. So he's retreated to a safe place - upstairs. Let him know that you are there for him - remove puppy and put her in the crate for a time out. He will realise you are on his side - still.
I don't think you should leave him upstairs - so he misses a few meals, he will eat when he gets hungry, and if you put puppy away while he's eating, he will know she's not going to be able to muscle in, and get on with it. I also don't think you should leave them alone at the moment. When you have to go out, put puppy in the crate, and leave him in the room with her.
I'm sure he's just in a snit at the moment, and once he realises that this new addition is a friend, a companion for him, he's going to love having her around.
I hope I can practise what I preach here because I'm going to be bringing a new puppy into our home in a few months. I have my last Basset, male, 11 years and he's having a very hard time since the loss of his sister 2 months ago, to cancer. He's never lived alone, and indeed was one of 6 adults, and his sister, when they were born. Gradually they've all gone. I'm switching breeds now (long story) and am just hoping my lad will accept, and come to love new puppy as much as he did his sister!