It would help if you would ask about memory, and RAM upgrades in your first post, instead of just "Is it possible to install Yosemite ... ? ) Yes, upgrade your OS X, that will work.
Two suggestions to Greatly Improve™ your OS X experience if you want to upgrade your OS X version.
4GB RAM will continue to work fairly well, but upgrading is easy. 8GB seems to be the tradeoff point now, giving you the greatest enhancement for the normal user.
You have 4 RAM slots, each can take as much as 4GB SODIMM, for a maximum of 16GB.
And, replacing your spinning hard drive with an SSD is much less expensive now. The OS X system, since Mavericks, seems better optimized for use on an SSD. Everything about how you work will feel (and be) faster than what you do now.
Do you need to do either of those upgrades?
No, but doing both RAM and SSD, plus the OS X upgrade, will make you remember what your brand-new iMac was like when you first used it 5 years ago - only better
