Absolutely. You can hold your coins for however long you wish, just make sure that you properly secure the wallet so no one else but you can get into it. I am guessing that if you are planning to hold the coins for a couple of years then that means that you will not be checking on your coins all the time, I would advise that you get a hardware wallet for storing your coins for such a long period of time.