Can you use yeast that is 2 years old if it has never been opened and has been in the freezer
If I were you, I'd do a simple test that determines, how active (= alive) your yeast is.

When you supply yeast with ideal living conditions, you can observe the activity - or lack of - as the yeast bubbles and foams.

For a test, you sprinkle yeast in lukewarm water and check for activity. A detailed description can be found here, for example.

This should give you the answer whether your yeast is still useable or not.