You can play the high 'a' as indicated on the second string and move back to the first position for the second part of the measure. You could also play the first half of the measure in the second position, playing the high 'a' on the fifth fret of the e-string. I would probably choose this latter option. The next bar is in the first position. So is the first half of the first bar in the next line. In the second half of that bar you need to move to the third position. The second bar of that line starts in the second position (I would play the second note - a 'C' - with my second finger, not with my third finger as indicated). The second half of that bar is played in the first position.
As a general remark, fingerings are recommendations. Many times there are alternative fingerings that sound as good or even better, and that may be more practical for you, so keep on experimenting. If you can't discuss these things with an experienced teacher, try to find a video or at least an audio recording to see and hear how a seasoned player plays the piece you're working on.