Is the word "way" used in the same way in the following two sentences?

Didn't know the way home.

It's a long way to Moscow.
different meanings