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

If you persist in that course you will surely fail.

Once a nation is embarked on a course of action it becomes extremely difficult for any retraction to take place.
the same meaning